All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] eal: move runtime dir creation after args parse
@ 2018-05-15 10:44 Anatoly Burakov
  2018-05-15 11:36 ` Andrew Rybchenko
  0 siblings, 1 reply; 4+ messages in thread
From: Anatoly Burakov @ 2018-05-15 10:44 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, arybchenko, thomas

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>
---
 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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] eal: move runtime dir creation after args parse
  2018-05-15 10:44 [PATCH] eal: move runtime dir creation after args parse Anatoly Burakov
@ 2018-05-15 11:36 ` Andrew Rybchenko
  2018-05-15 12:16   ` Burakov, Anatoly
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Rybchenko @ 2018-05-15 11:36 UTC (permalink / raw)
  To: Anatoly Burakov, dev; +Cc: Bruce Richardson, thomas

On 05/15/2018 01:44 PM, Anatoly Burakov wrote:
> 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>

I've tested it quickly and it solves the problem I observe.
I suppose it is OK that the directory remains after application exit.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] eal: move runtime dir creation after args parse
  2018-05-15 11:36 ` Andrew Rybchenko
@ 2018-05-15 12:16   ` Burakov, Anatoly
  2018-05-15 14:03     ` Thomas Monjalon
  0 siblings, 1 reply; 4+ messages in thread
From: Burakov, Anatoly @ 2018-05-15 12:16 UTC (permalink / raw)
  To: Andrew Rybchenko, dev; +Cc: Bruce Richardson, thomas

On 15-May-18 12:36 PM, Andrew Rybchenko wrote:
> On 05/15/2018 01:44 PM, Anatoly Burakov wrote:
>> 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>
> 
> I've tested it quickly and it solves the problem I observe.
> I suppose it is OK that the directory remains after application exit.
> 

Previously, all of the files that we were creating during runtime 
remained, so having a directory where all the files are is better than 
having a scattering of files :)

Thanks for testing!

-- 
Thanks,
Anatoly

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] eal: move runtime dir creation after args parse
  2018-05-15 12:16   ` Burakov, Anatoly
@ 2018-05-15 14:03     ` Thomas Monjalon
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2018-05-15 14:03 UTC (permalink / raw)
  To: Burakov, Anatoly; +Cc: dev, Andrew Rybchenko, Bruce Richardson

15/05/2018 14:16, Burakov, Anatoly:
> On 15-May-18 12:36 PM, Andrew Rybchenko wrote:
> > On 05/15/2018 01:44 PM, Anatoly Burakov wrote:
> >> 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>
> > 
> > I've tested it quickly and it solves the problem I observe.
> > I suppose it is OK that the directory remains after application exit.
> > 
> 
> Previously, all of the files that we were creating during runtime 
> remained, so having a directory where all the files are is better than 
> having a scattering of files :)
> 
> Thanks for testing!

Applied, thanks

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-05-15 14:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-15 10:44 [PATCH] eal: move runtime dir creation after args parse Anatoly Burakov
2018-05-15 11:36 ` Andrew Rybchenko
2018-05-15 12:16   ` Burakov, Anatoly
2018-05-15 14:03     ` Thomas Monjalon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.