From: David Marchand Date: Fri, 25 Oct 2019 13:56:10 +0000 (+0200) Subject: eal: make the global configuration private X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=f58cef079b054dba6739434db6f93390c4fd6c9a;p=dpdk.git eal: make the global configuration private Now that all elements of the rte_config structure have (deinlined) accessors, we can hide it. Signed-off-by: David Marchand Acked-by: Thomas Monjalon Acked-by: Anatoly Burakov --- diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst index 97a8c7cd9d..0e5bb5d3f1 100644 --- a/doc/guides/rel_notes/release_19_11.rst +++ b/doc/guides/rel_notes/release_19_11.rst @@ -291,6 +291,9 @@ API Changes * eal: removed the ``rte_malloc_virt2phy`` function, replaced by ``rte_malloc_virt2iova`` since v17.11. +* eal: made the ``rte_config`` struct and ``rte_eal_get_configuration`` + function private. + * mem: hid the internal ``malloc_heap`` structure and the ``rte_malloc_heap.h`` header. diff --git a/lib/librte_eal/common/eal_common_mcfg.c b/lib/librte_eal/common/eal_common_mcfg.c index 0665494322..0cf9a625fb 100644 --- a/lib/librte_eal/common/eal_common_mcfg.c +++ b/lib/librte_eal/common/eal_common_mcfg.c @@ -8,6 +8,7 @@ #include "eal_internal_cfg.h" #include "eal_memcfg.h" +#include "eal_private.h" void eal_mcfg_complete(void) diff --git a/lib/librte_eal/common/eal_private.h b/lib/librte_eal/common/eal_private.h index a8fac68aff..8a9d493f0c 100644 --- a/lib/librte_eal/common/eal_private.h +++ b/lib/librte_eal/common/eal_private.h @@ -36,6 +36,38 @@ struct lcore_config { extern struct lcore_config lcore_config[RTE_MAX_LCORE]; +/** + * The global RTE configuration structure. + */ +struct rte_config { + uint32_t master_lcore; /**< Id of the master lcore */ + uint32_t lcore_count; /**< Number of available logical cores. */ + uint32_t numa_node_count; /**< Number of detected NUMA nodes. */ + uint32_t numa_nodes[RTE_MAX_NUMA_NODES]; /**< List of detected NUMA nodes. */ + uint32_t service_lcore_count;/**< Number of available service cores. */ + enum rte_lcore_role_t lcore_role[RTE_MAX_LCORE]; /**< State of cores. */ + + /** Primary or secondary configuration */ + enum rte_proc_type_t process_type; + + /** PA or VA mapping mode */ + enum rte_iova_mode iova_mode; + + /** + * Pointer to memory configuration, which may be shared across multiple + * DPDK instances + */ + struct rte_mem_config *mem_config; +} __attribute__((__packed__)); + +/** + * Get the global configuration structure. + * + * @return + * A pointer to the global configuration structure. + */ +struct rte_config *rte_eal_get_configuration(void); + /** * Initialize the memzone subsystem (private to eal). * diff --git a/lib/librte_eal/common/include/rte_eal.h b/lib/librte_eal/common/include/rte_eal.h index ea3c9df719..2f9ed298de 100644 --- a/lib/librte_eal/common/include/rte_eal.h +++ b/lib/librte_eal/common/include/rte_eal.h @@ -51,38 +51,6 @@ enum rte_proc_type_t { RTE_PROC_INVALID }; -/** - * The global RTE configuration structure. - */ -struct rte_config { - uint32_t master_lcore; /**< Id of the master lcore */ - uint32_t lcore_count; /**< Number of available logical cores. */ - uint32_t numa_node_count; /**< Number of detected NUMA nodes. */ - uint32_t numa_nodes[RTE_MAX_NUMA_NODES]; /**< List of detected NUMA nodes. */ - uint32_t service_lcore_count;/**< Number of available service cores. */ - enum rte_lcore_role_t lcore_role[RTE_MAX_LCORE]; /**< State of cores. */ - - /** Primary or secondary configuration */ - enum rte_proc_type_t process_type; - - /** PA or VA mapping mode */ - enum rte_iova_mode iova_mode; - - /** - * Pointer to memory configuration, which may be shared across multiple - * DPDK instances - */ - struct rte_mem_config *mem_config; -} __attribute__((__packed__)); - -/** - * Get the global configuration structure. - * - * @return - * A pointer to the global configuration structure. - */ -struct rte_config *rte_eal_get_configuration(void); - /** * Get the process type in a multi-process setup * diff --git a/lib/librte_eal/common/malloc_heap.c b/lib/librte_eal/common/malloc_heap.c index 634ca212f2..842eb9de75 100644 --- a/lib/librte_eal/common/malloc_heap.c +++ b/lib/librte_eal/common/malloc_heap.c @@ -27,6 +27,7 @@ #include "eal_internal_cfg.h" #include "eal_memalloc.h" #include "eal_memcfg.h" +#include "eal_private.h" #include "malloc_elem.h" #include "malloc_heap.h" #include "malloc_mp.h" diff --git a/lib/librte_eal/common/rte_malloc.c b/lib/librte_eal/common/rte_malloc.c index fecd9a964d..044d3a9078 100644 --- a/lib/librte_eal/common/rte_malloc.c +++ b/lib/librte_eal/common/rte_malloc.c @@ -26,6 +26,7 @@ #include "malloc_heap.h" #include "eal_memalloc.h" #include "eal_memcfg.h" +#include "eal_private.h" /* Free the memory space back to heap */ diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map index d88649ed4b..3478d3b852 100644 --- a/lib/librte_eal/rte_eal_version.map +++ b/lib/librte_eal/rte_eal_version.map @@ -17,7 +17,6 @@ DPDK_2.0 { rte_dump_tailq; rte_eal_alarm_cancel; rte_eal_alarm_set; - rte_eal_get_configuration; rte_eal_get_lcore_state; rte_eal_get_physmem_size; rte_eal_has_hugepages;