[1/4] eal: move OS common config code to single file
Checks
Commit Message
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(-)
@@ -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;
+}
@@ -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)
@@ -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)
@@ -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)