DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] eal: move runtime config file to new location
@ 2018-05-31 15:35 Anatoly Burakov
  2018-07-13  9:42 ` Thomas Monjalon
  2018-07-13 10:44 ` [dpdk-dev] [PATCH v2] " Anatoly Burakov
  0 siblings, 2 replies; 4+ messages in thread
From: Anatoly Burakov @ 2018-05-31 15:35 UTC (permalink / raw)
  To: dev
  Cc: Neil Horman, John McNamara, Marko Kovacevic, thomas,
	bruce.richardson, harry.van.haaren

As per deprecation notice [1], move DPDK runtime config to default
DPDK runtime data location. Also, remove the deprecation notice.

[1] http://dpdk.org/dev/patchwork/patch/40418/

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 doc/guides/rel_notes/deprecation.rst   | 10 ----------
 lib/librte_eal/common/eal_filesystem.h | 10 +++-------
 2 files changed, 3 insertions(+), 17 deletions(-)

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 1ce692eac..ff15baa3f 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -8,16 +8,6 @@ API and ABI deprecation notices are to be posted here.
 Deprecation Notices
 -------------------
 
-* eal: DPDK runtime configuration file (located at
-  ``/var/run/.<prefix>_config``) will be moved. The new path will be as follows:
-
-  - if DPDK is running as root, path will be set to
-    ``/var/run/dpdk/<prefix>/config``
-  - if DPDK is not running as root and $XDG_RUNTIME_DIR is set, path will be set
-    to ``$XDG_RUNTIME_DIR/dpdk/<prefix>/config``
-  - if DPDK is not running as root and $XDG_RUNTIME_DIR is not set, path will be
-    set to ``/tmp/dpdk/<prefix>/config``
-
 * eal: both declaring and identifying devices will be streamlined in v18.08.
   New functions will appear to query a specific port from buses, classes of
   device and device drivers. Device declaration will be made coherent with the
diff --git a/lib/librte_eal/common/eal_filesystem.h b/lib/librte_eal/common/eal_filesystem.h
index 364f38d13..de05febf4 100644
--- a/lib/librte_eal/common/eal_filesystem.h
+++ b/lib/librte_eal/common/eal_filesystem.h
@@ -12,7 +12,6 @@
 #define EAL_FILESYSTEM_H
 
 /** Path of rte config file. */
-#define RUNTIME_CONFIG_FMT "%s/.%s_config"
 
 #include <stdint.h>
 #include <limits.h>
@@ -30,17 +29,14 @@ eal_create_runtime_dir(void);
 const char *
 eal_get_runtime_dir(void);
 
+#define RUNTIME_CONFIG_FNAME "config"
 static inline const char *
 eal_runtime_config_path(void)
 {
 	static char buffer[PATH_MAX]; /* static so auto-zeroed */
-	const char *directory = "/var/run";
-	const char *home_dir = getenv("HOME");
 
-	if (getuid() != 0 && home_dir != NULL)
-		directory = home_dir;
-	snprintf(buffer, sizeof(buffer) - 1, RUNTIME_CONFIG_FMT, directory,
-			internal_config.hugefile_prefix);
+	snprintf(buffer, sizeof(buffer) - 1, "%s/%s", eal_get_runtime_dir(),
+			RUNTIME_CONFIG_FNAME);
 	return buffer;
 }
 
-- 
2.17.0

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

* Re: [dpdk-dev] [PATCH] eal: move runtime config file to new location
  2018-05-31 15:35 [dpdk-dev] [PATCH] eal: move runtime config file to new location Anatoly Burakov
@ 2018-07-13  9:42 ` Thomas Monjalon
  2018-07-13 10:44 ` [dpdk-dev] [PATCH v2] " Anatoly Burakov
  1 sibling, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2018-07-13  9:42 UTC (permalink / raw)
  To: Anatoly Burakov
  Cc: dev, Neil Horman, John McNamara, Marko Kovacevic,
	bruce.richardson, harry.van.haaren

31/05/2018 17:35, Anatoly Burakov:
> As per deprecation notice [1], move DPDK runtime config to default
> DPDK runtime data location. Also, remove the deprecation notice.
> 
> [1] http://dpdk.org/dev/patchwork/patch/40418/
> 
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> ---
>  doc/guides/rel_notes/deprecation.rst   | 10 ----------
>  lib/librte_eal/common/eal_filesystem.h | 10 +++-------
>  2 files changed, 3 insertions(+), 17 deletions(-)

You should update the release notes too.
Let's consider this location as an API,
you could add a note in "API Changes".

Thanks

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

* [dpdk-dev] [PATCH v2] eal: move runtime config file to new location
  2018-05-31 15:35 [dpdk-dev] [PATCH] eal: move runtime config file to new location Anatoly Burakov
  2018-07-13  9:42 ` Thomas Monjalon
@ 2018-07-13 10:44 ` Anatoly Burakov
  2018-07-13 11:30   ` Thomas Monjalon
  1 sibling, 1 reply; 4+ messages in thread
From: Anatoly Burakov @ 2018-07-13 10:44 UTC (permalink / raw)
  To: dev
  Cc: Neil Horman, John McNamara, Marko Kovacevic, thomas,
	bruce.richardson, harry.van.haaren

As per deprecation notice [1], move DPDK runtime config to default
DPDK runtime data location. Also, remove the deprecation notice and
update release notes to indicate the changes.

[1] http://dpdk.org/dev/patchwork/patch/40418/

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 doc/guides/rel_notes/deprecation.rst   | 10 ----------
 doc/guides/rel_notes/release_18_08.rst |  7 +++++++
 lib/librte_eal/common/eal_filesystem.h | 10 +++-------
 3 files changed, 10 insertions(+), 17 deletions(-)

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 5de59833d..14714fe94 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -8,16 +8,6 @@ API and ABI deprecation notices are to be posted here.
 Deprecation Notices
 -------------------
 
-* eal: DPDK runtime configuration file (located at
-  ``/var/run/.<prefix>_config``) will be moved. The new path will be as follows:
-
-  - if DPDK is running as root, path will be set to
-    ``/var/run/dpdk/<prefix>/config``
-  - if DPDK is not running as root and $XDG_RUNTIME_DIR is set, path will be set
-    to ``$XDG_RUNTIME_DIR/dpdk/<prefix>/config``
-  - if DPDK is not running as root and $XDG_RUNTIME_DIR is not set, path will be
-    set to ``/tmp/dpdk/<prefix>/config``
-
 * eal: both declaring and identifying devices will be streamlined in v18.08.
   New functions will appear to query a specific port from buses, classes of
   device and device drivers. Device declaration will be made coherent with the
diff --git a/doc/guides/rel_notes/release_18_08.rst b/doc/guides/rel_notes/release_18_08.rst
index d41546c27..ebe7e6bd6 100644
--- a/doc/guides/rel_notes/release_18_08.rst
+++ b/doc/guides/rel_notes/release_18_08.rst
@@ -129,6 +129,13 @@ API Changes
   - ``RTE_COMP_FF_OOP_SGL_IN_LB_OUT``
   - ``RTE_COMP_FF_OOP_LB_IN_SGL_OUT``
 
+* Path to runtime config file has changed. The new path is determined as
+  follows:
+  - If DPDK is running as root, ``/var/run/dpdk/<prefix>/config``
+  - If DPDK is not running as root:
+    - If ``$XDG_RUNTIME_DIR`` is set, ``${XDG_RUNTIME_DIR}/dpdk/<prefix>/config``
+    - Otherwise, ``/tmp/dpdk/<prefix>/config``
+
 
 ABI Changes
 -----------
diff --git a/lib/librte_eal/common/eal_filesystem.h b/lib/librte_eal/common/eal_filesystem.h
index 364f38d13..de05febf4 100644
--- a/lib/librte_eal/common/eal_filesystem.h
+++ b/lib/librte_eal/common/eal_filesystem.h
@@ -12,7 +12,6 @@
 #define EAL_FILESYSTEM_H
 
 /** Path of rte config file. */
-#define RUNTIME_CONFIG_FMT "%s/.%s_config"
 
 #include <stdint.h>
 #include <limits.h>
@@ -30,17 +29,14 @@ eal_create_runtime_dir(void);
 const char *
 eal_get_runtime_dir(void);
 
+#define RUNTIME_CONFIG_FNAME "config"
 static inline const char *
 eal_runtime_config_path(void)
 {
 	static char buffer[PATH_MAX]; /* static so auto-zeroed */
-	const char *directory = "/var/run";
-	const char *home_dir = getenv("HOME");
 
-	if (getuid() != 0 && home_dir != NULL)
-		directory = home_dir;
-	snprintf(buffer, sizeof(buffer) - 1, RUNTIME_CONFIG_FMT, directory,
-			internal_config.hugefile_prefix);
+	snprintf(buffer, sizeof(buffer) - 1, "%s/%s", eal_get_runtime_dir(),
+			RUNTIME_CONFIG_FNAME);
 	return buffer;
 }
 
-- 
2.17.1

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

* Re: [dpdk-dev] [PATCH v2] eal: move runtime config file to new location
  2018-07-13 10:44 ` [dpdk-dev] [PATCH v2] " Anatoly Burakov
@ 2018-07-13 11:30   ` Thomas Monjalon
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2018-07-13 11:30 UTC (permalink / raw)
  To: Anatoly Burakov
  Cc: dev, Neil Horman, John McNamara, Marko Kovacevic,
	bruce.richardson, harry.van.haaren

13/07/2018 12:44, Anatoly Burakov:
> As per deprecation notice [1], move DPDK runtime config to default
> DPDK runtime data location. Also, remove the deprecation notice and
> update release notes to indicate the changes.
> 
> [1] http://dpdk.org/dev/patchwork/patch/40418/
> 
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>

Applied (with a syntax fix in doc), thanks

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

end of thread, other threads:[~2018-07-13 11:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-31 15:35 [dpdk-dev] [PATCH] eal: move runtime config file to new location Anatoly Burakov
2018-07-13  9:42 ` Thomas Monjalon
2018-07-13 10:44 ` [dpdk-dev] [PATCH v2] " Anatoly Burakov
2018-07-13 11:30   ` Thomas Monjalon

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