From patchwork Mon Jun 1 09:38:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tal Shnaiderman X-Patchwork-Id: 70711 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id D71A2A04EF; Mon, 1 Jun 2020 11:38:29 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id ECC121D162; Mon, 1 Jun 2020 11:38:28 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 511291D160 for ; Mon, 1 Jun 2020 11:38:27 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE2 (envelope-from talshn@mellanox.com) with ESMTPS (AES256-SHA encrypted); 1 Jun 2020 12:38:25 +0300 Received: from l-wincomp04-vm.labs.mlnx (l-wincomp04-vm.mtl.labs.mlnx [10.237.1.5]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 0519cPva023724; Mon, 1 Jun 2020 12:38:25 +0300 From: talshn@mellanox.com To: dev@dpdk.org Cc: thomas@monjalon.net, pallavi.kadam@intel.com, dmitry.kozliuk@gmail.com, david.marchand@redhat.com, olivier.matz@6wind.com, ranjit.menon@intel.com, navasile@linux.microsoft.com, fady@mellanox.com, harini.ramakrishnan@microsoft.com, ocardona@microsoft.com, Tal Shnaiderman Date: Mon, 1 Jun 2020 12:38:15 +0300 Message-Id: <20200601093818.5420-2-talshn@mellanox.com> X-Mailer: git-send-email 2.16.1.windows.4 In-Reply-To: <20200601093818.5420-1-talshn@mellanox.com> References: <20200601093818.5420-1-talshn@mellanox.com> Subject: [dpdk-dev] [PATCH 1/4] eal: move OS common config code to single file 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" From: Tal Shnaiderman Move common struct rte_config and function rte_eal_mbuf_user_pool_ops to eal_config. Signed-off-by: Tal Shnaiderman --- lib/librte_eal/common/eal_common_config.c | 11 +++++++++++ lib/librte_eal/freebsd/eal.c | 10 ---------- lib/librte_eal/linux/eal.c | 10 ---------- lib/librte_eal/windows/eal.c | 3 --- 4 files changed, 11 insertions(+), 23 deletions(-) diff --git a/lib/librte_eal/common/eal_common_config.c b/lib/librte_eal/common/eal_common_config.c index 641c7d884c..c69a088182 100644 --- a/lib/librte_eal/common/eal_common_config.c +++ b/lib/librte_eal/common/eal_common_config.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2020 Mellanox Technologies, Ltd */ +#include #include #include @@ -13,6 +14,9 @@ struct rte_config rte_config = { .mem_config = &early_mem_config, }; +/* internal configuration */ +struct internal_config internal_config; + const char * rte_eal_get_runtime_dir(void) { @@ -37,3 +41,10 @@ rte_eal_process_type(void) { return rte_config.process_type; } + +/* Return user provided mbuf pool ops name */ +const char * +rte_eal_mbuf_user_pool_ops(void) +{ + return internal_config.user_mbuf_pool_ops_name; +} diff --git a/lib/librte_eal/freebsd/eal.c b/lib/librte_eal/freebsd/eal.c index eab961232e..6be7414f1a 100644 --- a/lib/librte_eal/freebsd/eal.c +++ b/lib/librte_eal/freebsd/eal.c @@ -73,9 +73,6 @@ static struct flock wr_lock = { /* internal configuration (per-core) */ struct lcore_config lcore_config[RTE_MAX_LCORE]; -/* internal configuration */ -struct internal_config internal_config; - /* used by rte_rdtsc() */ int rte_cycles_vmware_tsc_map; @@ -141,13 +138,6 @@ eal_clean_runtime_dir(void) return 0; } -/* Return user provided mbuf pool ops name */ -const char * -rte_eal_mbuf_user_pool_ops(void) -{ - return internal_config.user_mbuf_pool_ops_name; -} - /* parse a sysfs (or other) file containing one integer value */ int eal_parse_sysfs_value(const char *filename, unsigned long *val) diff --git a/lib/librte_eal/linux/eal.c b/lib/librte_eal/linux/eal.c index 8cbb8c644c..302f0a1228 100644 --- a/lib/librte_eal/linux/eal.c +++ b/lib/librte_eal/linux/eal.c @@ -86,9 +86,6 @@ static struct flock wr_lock = { /* internal configuration (per-core) */ struct lcore_config lcore_config[RTE_MAX_LCORE]; -/* internal configuration */ -struct internal_config internal_config; - /* used by rte_rdtsc() */ int rte_cycles_vmware_tsc_map; @@ -230,13 +227,6 @@ eal_clean_runtime_dir(void) return -1; } -/* Return user provided mbuf pool ops name */ -const char * -rte_eal_mbuf_user_pool_ops(void) -{ - return internal_config.user_mbuf_pool_ops_name; -} - /* parse a sysfs (or other) file containing one integer value */ int eal_parse_sysfs_value(const char *filename, unsigned long *val) diff --git a/lib/librte_eal/windows/eal.c b/lib/librte_eal/windows/eal.c index 2a05f9e0da..daa238d416 100644 --- a/lib/librte_eal/windows/eal.c +++ b/lib/librte_eal/windows/eal.c @@ -35,9 +35,6 @@ static int mem_cfg_fd = -1; /* internal configuration (per-core) */ struct lcore_config lcore_config[RTE_MAX_LCORE]; -/* internal configuration */ -struct internal_config internal_config; - /* Detect if we are a primary or a secondary process */ enum rte_proc_type_t eal_proc_type_detect(void)