From patchwork Thu May 31 15:35:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatoly Burakov X-Patchwork-Id: 40556 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 02CF45F35; Thu, 31 May 2018 17:35:48 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id C94455F2F for ; Thu, 31 May 2018 17:35:46 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 May 2018 08:35:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,463,1520924400"; d="scan'208";a="228859875" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga005.jf.intel.com with ESMTP; 31 May 2018 08:35:43 -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 w4VFZhxa021271; Thu, 31 May 2018 16:35:43 +0100 Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id w4VFZhvG024462; Thu, 31 May 2018 16:35:43 +0100 Received: (from aburakov@localhost) by sivswdev01.ir.intel.com with LOCAL id w4VFZgw2024456; Thu, 31 May 2018 16:35:42 +0100 From: Anatoly Burakov To: dev@dpdk.org Cc: Neil Horman , John McNamara , Marko Kovacevic , thomas@monjalon.net, bruce.richardson@intel.com, harry.van.haaren@intel.com Date: Thu, 31 May 2018 16:35:42 +0100 Message-Id: X-Mailer: git-send-email 1.7.0.7 Subject: [dpdk-dev] [PATCH] eal: move runtime config file to new location 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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/._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/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 #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; }