/* used by rte_rdtsc() */
int rte_cycles_vmware_tsc_map;
-static const char *default_runtime_dir = "/var/run";
-
int
eal_create_runtime_dir(void)
{
- const char *directory = default_runtime_dir;
- const char *xdg_runtime_dir = getenv("XDG_RUNTIME_DIR");
- const char *fallback = "/tmp";
+ const char *directory;
char run_dir[PATH_MAX];
char tmp[PATH_MAX];
int ret;
- if (getuid() != 0) {
- /* try XDG path first, fall back to /tmp */
- if (xdg_runtime_dir != NULL)
- directory = xdg_runtime_dir;
+ /* from RuntimeDirectory= see systemd.exec */
+ directory = getenv("RUNTIME_DIRECTORY");
+ if (directory == NULL) {
+ /*
+ * Used standard convention defined in
+ * XDG Base Directory Specification and
+ * Filesystem Hierarchy Standard.
+ */
+ if (getuid() == 0)
+ directory = "/var/run";
else
- directory = fallback;
+ directory = getenv("XDG_RUNTIME_DIR") ? : "/tmp";
}
+
/* create DPDK subdirectory under runtime dir */
ret = snprintf(tmp, sizeof(tmp), "%s/dpdk", directory);
if (ret < 0 || ret == sizeof(tmp)) {
return -1;
}
- if (eal_set_runtime_dir(run_dir, sizeof(run_dir)))
+ if (eal_set_runtime_dir(run_dir))
return -1;
return 0;
char * arg[RTE_MAX_NUMA_NODES];
char *end;
int arg_num, i, len;
- uint64_t total_mem = 0;
len = strnlen(strval, SOCKET_MEM_STRLEN);
if (len == SOCKET_MEM_STRLEN) {
(arg[i][0] == '\0') || (end == NULL) || (*end != '\0'))
return -1;
val <<= 20;
- total_mem += val;
socket_arg[i] = val;
}
struct internal_config *internal_conf =
eal_get_internal_configuration();
- if (rte_eal_process_type() == RTE_PROC_PRIMARY)
+ if (rte_eal_process_type() == RTE_PROC_PRIMARY &&
+ internal_conf->hugepage_file.unlink_existing)
rte_memseg_walk(mark_freeable, NULL);
rte_service_finalize();
rte_mp_channel_cleanup();
/* after this point, any DPDK pointers will become dangling */
rte_eal_memory_detach();
+ rte_eal_alarm_cleanup();
rte_trace_save();
eal_trace_fini();
eal_cleanup_config(internal_conf);