[dpdk-dev] [PATCH 1/4] eal: move OS common config code to single file
talshn at mellanox.com
talshn at mellanox.com
Mon Jun 1 11:38:15 CEST 2020
From: Tal Shnaiderman <talshn at mellanox.com>
Move common struct rte_config and function
rte_eal_mbuf_user_pool_ops to eal_config.
Signed-off-by: Tal Shnaiderman <talshn at 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(-)
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)
--
2.16.1.windows.4
More information about the dev
mailing list