[dpdk-dev] [PATCH v3 7/7] dpaa: register dpaa as platform HW mempool on runtime

Hemant Agrawal hemant.agrawal at nxp.com
Thu Jan 18 14:26:32 CET 2018


Signed-off-by: Hemant Agrawal <hemant.agrawal at nxp.com>
---
 config/defconfig_arm64-dpaa-linuxapp-gcc | 1 -
 drivers/bus/dpaa/dpaa_bus.c              | 2 ++
 drivers/bus/dpaa/rte_dpaa_bus.h          | 2 ++
 drivers/mempool/dpaa/dpaa_mempool.c      | 2 +-
 4 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/config/defconfig_arm64-dpaa-linuxapp-gcc b/config/defconfig_arm64-dpaa-linuxapp-gcc
index 5f882ca..ba1a1bd 100644
--- a/config/defconfig_arm64-dpaa-linuxapp-gcc
+++ b/config/defconfig_arm64-dpaa-linuxapp-gcc
@@ -25,7 +25,6 @@ CONFIG_RTE_LIBRTE_DPAA_HWDEBUG=n
 
 # NXP DPAA Mempool
 CONFIG_RTE_LIBRTE_DPAA_MEMPOOL=y
-CONFIG_RTE_MBUF_DEFAULT_MEMPOOL_OPS="dpaa"
 
 # Compile software NXP DPAA PMD
 CONFIG_RTE_LIBRTE_DPAA_PMD=y
diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index 329a125..4cec726 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -31,6 +31,7 @@
 #include <rte_malloc.h>
 #include <rte_ring.h>
 #include <rte_bus.h>
+#include <rte_mbuf_pool_ops.h>
 
 #include <rte_dpaa_bus.h>
 #include <rte_dpaa_logs.h>
@@ -467,6 +468,7 @@ rte_dpaa_bus_probe(void)
 			break;
 		}
 	}
+	rte_mbuf_register_platform_mempool_ops(DPAA_MEMPOOL_OPS_NAME);
 
 	svr_file = fopen(DPAA_SOC_ID_FILE, "r");
 	if (svr_file) {
diff --git a/drivers/bus/dpaa/rte_dpaa_bus.h b/drivers/bus/dpaa/rte_dpaa_bus.h
index d9ade83..280443d 100644
--- a/drivers/bus/dpaa/rte_dpaa_bus.h
+++ b/drivers/bus/dpaa/rte_dpaa_bus.h
@@ -17,6 +17,8 @@
 
 #define FSL_DPAA_BUS_NAME	"FSL_DPAA_BUS"
 
+#define DPAA_MEMPOOL_OPS_NAME	"dpaa"
+
 #define DEV_TO_DPAA_DEVICE(ptr)	\
 		container_of(ptr, struct rte_dpaa_device, device)
 
diff --git a/drivers/mempool/dpaa/dpaa_mempool.c b/drivers/mempool/dpaa/dpaa_mempool.c
index ffb81c2..0e8159a 100644
--- a/drivers/mempool/dpaa/dpaa_mempool.c
+++ b/drivers/mempool/dpaa/dpaa_mempool.c
@@ -247,7 +247,7 @@ dpaa_mbuf_get_count(const struct rte_mempool *mp)
 }
 
 struct rte_mempool_ops dpaa_mpool_ops = {
-	.name = "dpaa",
+	.name = DPAA_MEMPOOL_OPS_NAME,
 	.alloc = dpaa_mbuf_create_pool,
 	.free = dpaa_mbuf_free_pool,
 	.enqueue = dpaa_mbuf_free_bulk,
-- 
2.7.4



More information about the dev mailing list