DPDK patches and discussions
 help / color / mirror / Atom feed
From: Anatoly Burakov <anatoly.burakov@intel.com>
To: dev@dpdk.org
Cc: Bruce Richardson <bruce.richardson@intel.com>
Subject: [dpdk-dev] [PATCH] eal: fix runtime dir cleanup in noshconf mode
Date: Thu, 20 Dec 2018 11:11:48 +0000	[thread overview]
Message-ID: <e41a1a5b087d7bbe93e6bef424637fabb541383e.1545304267.git.anatoly.burakov@intel.com> (raw)

When using --no-shconf or --in-memory modes, there is no runtime
directory to be created, so there is no point in attempting to
clean it.

Fixes: 0a529578f162 ("eal: clean up unused files on initialization")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 lib/librte_eal/bsdapp/eal/eal.c   | 5 ++++-
 lib/librte_eal/linuxapp/eal/eal.c | 5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c
index 41ddb5a22..20f790a71 100644
--- a/lib/librte_eal/bsdapp/eal/eal.c
+++ b/lib/librte_eal/bsdapp/eal/eal.c
@@ -901,8 +901,11 @@ rte_eal_init(int argc, char **argv)
 	 * 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.
+	 *
+	 * In no_shconf mode, no runtime directory is created in the first
+	 * place, so no cleanup needed.
 	 */
-	if (eal_clean_runtime_dir() < 0) {
+	if (!internal_config.no_shconf && eal_clean_runtime_dir() < 0) {
 		rte_eal_init_alert("Cannot clear runtime directory\n");
 		return -1;
 	}
diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c
index d252c8591..acac92987 100644
--- a/lib/librte_eal/linuxapp/eal/eal.c
+++ b/lib/librte_eal/linuxapp/eal/eal.c
@@ -1189,8 +1189,11 @@ rte_eal_init(int argc, char **argv)
 	 * 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.
+	 *
+	 * In no_shconf mode, no runtime directory is created in the first
+	 * place, so no cleanup needed.
 	 */
-	if (eal_clean_runtime_dir() < 0) {
+	if (!internal_config.no_shconf && eal_clean_runtime_dir() < 0) {
 		rte_eal_init_alert("Cannot clear runtime directory\n");
 		return -1;
 	}
-- 
2.17.1

             reply	other threads:[~2018-12-20 11:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-20 11:11 Anatoly Burakov [this message]
2018-12-20 22:30 ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e41a1a5b087d7bbe93e6bef424637fabb541383e.1545304267.git.anatoly.burakov@intel.com \
    --to=anatoly.burakov@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).