[1/4] eal: move OS common config code to single file

Message ID 20200601093818.5420-2-talshn@mellanox.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series Support librte_mbuf on Windows |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail apply issues

Commit Message

Tal Shnaiderman June 1, 2020, 9:38 a.m. UTC
  From: Tal Shnaiderman <talshn@mellanox.com>

Move common struct rte_config and function
rte_eal_mbuf_user_pool_ops to eal_config.

Signed-off-by: Tal Shnaiderman <talshn@mellanox.com>
---
 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(-)
  

Patch

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 <eal_internal_cfg.h>
 #include <eal_private.h>
 
 #include <rte_os.h>
@@ -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)