From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 43F9B1B85F for ; Tue, 15 May 2018 12:44:56 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 May 2018 03:44:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,403,1520924400"; d="scan'208";a="228696261" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga006.fm.intel.com with ESMTP; 15 May 2018 03:44:53 -0700 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id w4FAirpO003053; Tue, 15 May 2018 11:44:53 +0100 Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id w4FAiqgL009676; Tue, 15 May 2018 11:44:52 +0100 Received: (from aburakov@localhost) by sivswdev01.ir.intel.com with LOCAL id w4FAiqBc009672; Tue, 15 May 2018 11:44:52 +0100 From: Anatoly Burakov To: dev@dpdk.org Cc: Bruce Richardson , arybchenko@solarflare.com, thomas@monjalon.net Date: Tue, 15 May 2018 11:44:52 +0100 Message-Id: X-Mailer: git-send-email 1.7.0.7 Subject: [dpdk-dev] [PATCH] eal: move runtime dir creation after args parse X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 May 2018 10:44:57 -0000 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 Signed-off-by: Anatoly Burakov --- lib/librte_eal/bsdapp/eal/eal.c | 14 +++++++------- lib/librte_eal/linuxapp/eal/eal.c | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c index c890bfe..7f8475e 100644 --- a/lib/librte_eal/bsdapp/eal/eal.c +++ b/lib/librte_eal/bsdapp/eal/eal.c @@ -586,13 +586,6 @@ rte_eal_init(int argc, char **argv) /* 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; @@ -607,6 +600,13 @@ rte_eal_init(int argc, char **argv) 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; diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c index bed5823..150d5dd 100644 --- a/lib/librte_eal/linuxapp/eal/eal.c +++ b/lib/librte_eal/linuxapp/eal/eal.c @@ -803,13 +803,6 @@ rte_eal_init(int argc, char **argv) /* 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; @@ -824,6 +817,13 @@ rte_eal_init(int argc, char **argv) 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; -- 2.7.4