The intention of the original code was to create runtime data
directory as early as possible, however it was moved too early,
before the arguments were parsed, resulting in --file-prefix
option essentially not working.
Fix this by moving eal_create_runtime_dir() to after command
line arguments parsing.
Fixes:
56236363b481 ("eal: add directory for runtime data")
Reported-by: Andrew Rybchenko <arybchenko@solarflare.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Tested-by: Andrew Rybchenko <arybchenko@solarflare.com>
/* set log level as early as possible */
eal_log_level_parse(argc, argv);
- /* create runtime data directory */
- if (eal_create_runtime_dir() < 0) {
- rte_eal_init_alert("Cannot create runtime directory\n");
- rte_errno = EACCES;
- return -1;
- }
-
if (rte_eal_cpu_init() < 0) {
rte_eal_init_alert("Cannot detect lcores.");
rte_errno = ENOTSUP;
return -1;
}
+ /* create runtime data directory */
+ if (eal_create_runtime_dir() < 0) {
+ rte_eal_init_alert("Cannot create runtime directory\n");
+ rte_errno = EACCES;
+ return -1;
+ }
+
/* FreeBSD always uses legacy memory model */
internal_config.legacy_mem = true;
/* set log level as early as possible */
eal_log_level_parse(argc, argv);
- /* create runtime data directory */
- if (eal_create_runtime_dir() < 0) {
- rte_eal_init_alert("Cannot create runtime directory\n");
- rte_errno = EACCES;
- return -1;
- }
-
if (rte_eal_cpu_init() < 0) {
rte_eal_init_alert("Cannot detect lcores.");
rte_errno = ENOTSUP;
return -1;
}
+ /* create runtime data directory */
+ if (eal_create_runtime_dir() < 0) {
+ rte_eal_init_alert("Cannot create runtime directory\n");
+ rte_errno = EACCES;
+ return -1;
+ }
+
if (eal_plugins_init() < 0) {
rte_eal_init_alert("Cannot init plugins\n");
rte_errno = EINVAL;