From adf1d867361cbe1b5e6803f22520da9da1187b4a Mon Sep 17 00:00:00 2001 From: Anatoly Burakov Date: Fri, 13 Jul 2018 11:44:48 +0100 Subject: [PATCH] eal: move runtime config file to new location 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/patch/40418 Signed-off-by: Anatoly Burakov --- doc/guides/rel_notes/deprecation.rst | 10 ---------- doc/guides/rel_notes/release_18_08.rst | 9 +++++++++ lib/librte_eal/common/eal_filesystem.h | 10 +++------- 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index 5de59833d6..14714fe941 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/._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//config`` - - if DPDK is not running as root and $XDG_RUNTIME_DIR is set, path will be set - to ``$XDG_RUNTIME_DIR/dpdk//config`` - - if DPDK is not running as root and $XDG_RUNTIME_DIR is not set, path will be - set to ``/tmp/dpdk//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 d41546c273..550b11049d 100644 --- a/doc/guides/rel_notes/release_18_08.rst +++ b/doc/guides/rel_notes/release_18_08.rst @@ -82,6 +82,15 @@ API Changes Also, make sure to start the actual text at the margin. ========================================================= +* Path to runtime config file has changed. The new path is determined as + follows: + + - If DPDK is running as root, ``/var/run/dpdk//config`` + - If DPDK is not running as root: + + * If ``$XDG_RUNTIME_DIR`` is set, ``${XDG_RUNTIME_DIR}/dpdk//config`` + * Otherwise, ``/tmp/dpdk//config`` + * cryptodev: In struct ``struct rte_cryptodev_info``, field ``rte_pci_device *pci_dev`` has been replaced with field ``struct rte_device *device``. Value 0 is accepted in ``sym.max_nb_sessions``, meaning that a device diff --git a/lib/librte_eal/common/eal_filesystem.h b/lib/librte_eal/common/eal_filesystem.h index 364f38d13d..de05febf4f 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 #include @@ -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.20.1