diff options
author | Christian Ehrhardt <christian.ehrhardt@canonical.com> | 2019-04-15 14:36:48 +0200 |
---|---|---|
committer | Christian Ehrhardt <christian.ehrhardt@canonical.com> | 2019-04-16 08:38:15 +0200 |
commit | 0b6b37f6a2ee1764e8912fe9f57dd4ed2baadecd (patch) | |
tree | e9c4dd16e978e7b5c4f59efb8a63fe110786592b /lib/librte_eal/bsdapp | |
parent | ba7d9829e24a32d31b31f5816e8b9a3a8799ba68 (diff) |
New upstream version 18.11.1
Change-Id: I2394f61ba94cc575bf2c55186f14e5d6fba9eec7
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Diffstat (limited to 'lib/librte_eal/bsdapp')
-rw-r--r-- | lib/librte_eal/bsdapp/eal/eal.c | 42 |
1 files changed, 39 insertions, 3 deletions
diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c index b8152a75..f01495e3 100644 --- a/lib/librte_eal/bsdapp/eal/eal.c +++ b/lib/librte_eal/bsdapp/eal/eal.c @@ -115,7 +115,7 @@ eal_create_runtime_dir(void) /* create prefix-specific subdirectory under DPDK runtime dir */ ret = snprintf(runtime_dir, sizeof(runtime_dir), "%s/%s", - tmp, internal_config.hugefile_prefix); + tmp, eal_get_hugefile_prefix()); if (ret < 0 || ret == sizeof(runtime_dir)) { RTE_LOG(ERR, EAL, "Error creating prefix-specific runtime path name\n"); return -1; @@ -141,6 +141,16 @@ eal_create_runtime_dir(void) return 0; } +int +eal_clean_runtime_dir(void) +{ + /* FreeBSD doesn't need this implemented for now, because, unlike Linux, + * FreeBSD doesn't create per-process files, so no need to clean up. + */ + return 0; +} + + const char * rte_eal_get_runtime_dir(void) { @@ -447,9 +457,21 @@ eal_parse_args(int argc, char **argv) switch (opt) { case OPT_MBUF_POOL_OPS_NAME_NUM: - internal_config.user_mbuf_pool_ops_name = - strdup(optarg); + { + char *ops_name = strdup(optarg); + if (ops_name == NULL) + RTE_LOG(ERR, EAL, "Could not store mbuf pool ops name\n"); + else { + /* free old ops name */ + if (internal_config.user_mbuf_pool_ops_name != + NULL) + free(internal_config.user_mbuf_pool_ops_name); + + internal_config.user_mbuf_pool_ops_name = + ops_name; + } break; + } case 'h': eal_usage(prgname); exit(EXIT_SUCCESS); @@ -807,6 +829,18 @@ rte_eal_init(int argc, char **argv) return -1; } + /* + * Clean up unused files in runtime directory. We do this at the end of + * init and not at the beginning because we want to clean stuff up + * whether we are primary or secondary process, but we cannot remove + * primary process' files because secondary should be able to run even + * if primary process is dead. + */ + if (eal_clean_runtime_dir() < 0) { + rte_eal_init_alert("Cannot clear runtime directory\n"); + return -1; + } + rte_eal_mcfg_complete(); /* Call each registered callback, if enabled */ @@ -819,6 +853,8 @@ int __rte_experimental rte_eal_cleanup(void) { rte_service_finalize(); + rte_mp_channel_cleanup(); + eal_cleanup_config(&internal_config); return 0; } |