[dpdk-dev] [PATCH v2 11/14] eal: uninline wait for mcfg complete function
Anatoly Burakov
anatoly.burakov at intel.com
Tue Jun 25 18:05:23 CEST 2019
Currently, the function to wait until config completion is
static inline for no reason. Move its implementation to
an EAL common file.
Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
---
lib/librte_eal/common/eal_common_mcfg.c | 10 ++++++++++
lib/librte_eal/common/eal_memcfg.h | 10 +++-------
lib/librte_eal/freebsd/eal/eal.c | 3 ++-
lib/librte_eal/linux/eal/eal.c | 2 +-
4 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/lib/librte_eal/common/eal_common_mcfg.c b/lib/librte_eal/common/eal_common_mcfg.c
index 337890a61..30969c6bf 100644
--- a/lib/librte_eal/common/eal_common_mcfg.c
+++ b/lib/librte_eal/common/eal_common_mcfg.c
@@ -7,6 +7,16 @@
#include "eal_memcfg.h"
+void
+eal_mcfg_wait_complete(void)
+{
+ struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
+
+ /* wait until shared mem_config finish initialising */
+ while (mcfg->magic != RTE_MAGIC)
+ rte_pause();
+}
+
void
rte_mcfg_mem_read_lock(void)
{
diff --git a/lib/librte_eal/common/eal_memcfg.h b/lib/librte_eal/common/eal_memcfg.h
index 22459a55a..7319d9f7a 100644
--- a/lib/librte_eal/common/eal_memcfg.h
+++ b/lib/librte_eal/common/eal_memcfg.h
@@ -68,12 +68,8 @@ struct rte_mem_config {
uint8_t dma_maskbits;
};
-static inline void
-rte_eal_mcfg_wait_complete(struct rte_mem_config *mcfg)
-{
- /* wait until shared mem_config finish initialising */
- while (mcfg->magic != RTE_MAGIC)
- rte_pause();
-}
+/* wait until primary process initialization is complete */
+void
+eal_mcfg_wait_complete(void);
#endif /* EAL_MEMCFG_H */
diff --git a/lib/librte_eal/freebsd/eal/eal.c b/lib/librte_eal/freebsd/eal/eal.c
index ce7a5f91d..b3c96b5cd 100644
--- a/lib/librte_eal/freebsd/eal/eal.c
+++ b/lib/librte_eal/freebsd/eal/eal.c
@@ -52,6 +52,7 @@
#include "eal_filesystem.h"
#include "eal_hugepages.h"
#include "eal_options.h"
+#include "eal_memcfg.h"
#define MEMSIZE_IF_NO_HUGE_PAGE (64ULL * 1024ULL * 1024ULL)
@@ -352,7 +353,7 @@ rte_config_init(void)
break;
case RTE_PROC_SECONDARY:
rte_eal_config_attach();
- rte_eal_mcfg_wait_complete(rte_config.mem_config);
+ eal_mcfg_wait_complete();
rte_eal_config_reattach();
break;
case RTE_PROC_AUTO:
diff --git a/lib/librte_eal/linux/eal/eal.c b/lib/librte_eal/linux/eal/eal.c
index 0fc99de5b..9168a3e47 100644
--- a/lib/librte_eal/linux/eal/eal.c
+++ b/lib/librte_eal/linux/eal/eal.c
@@ -474,7 +474,7 @@ rte_config_init(void)
break;
case RTE_PROC_SECONDARY:
rte_eal_config_attach();
- rte_eal_mcfg_wait_complete(rte_config.mem_config);
+ eal_mcfg_wait_complete();
rte_eal_config_reattach();
eal_update_internal_config();
break;
--
2.17.1
More information about the dev
mailing list