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

Hemant Agrawal hemant.agrawal at nxp.com
Mon Jan 22 14:51:23 CET 2018


Detect if the DPAA2 mempool objects are present and register
it as platform default hw mempool

Signed-off-by: Hemant Agrawal <hemant.agrawal at nxp.com>
---
 config/defconfig_arm64-dpaa2-linuxapp-gcc | 1 -
 drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c  | 3 +++
 drivers/bus/fslmc/portal/dpaa2_hw_pvt.h   | 2 ++
 drivers/mempool/dpaa2/dpaa2_hw_mempool.c  | 2 +-
 4 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/config/defconfig_arm64-dpaa2-linuxapp-gcc b/config/defconfig_arm64-dpaa2-linuxapp-gcc
index d38d696..5d4437c 100644
--- a/config/defconfig_arm64-dpaa2-linuxapp-gcc
+++ b/config/defconfig_arm64-dpaa2-linuxapp-gcc
@@ -26,7 +26,6 @@ CONFIG_RTE_LIBRTE_VHOST_NUMA=n
 # Compile Support Libraries for DPAA2
 #
 CONFIG_RTE_LIBRTE_DPAA2_MEMPOOL=y
-CONFIG_RTE_MBUF_DEFAULT_MEMPOOL_OPS="dpaa2"
 CONFIG_RTE_LIBRTE_DPAA2_USE_PHYS_IOVA=n
 
 #
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c
index 139249c..9081625 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c
@@ -20,6 +20,7 @@
 #include <rte_kvargs.h>
 #include <rte_dev.h>
 #include <rte_ethdev_driver.h>
+#include <rte_mbuf_pool_ops.h>
 
 #include <fslmc_logs.h>
 #include <rte_fslmc.h>
@@ -74,6 +75,8 @@ dpaa2_create_dpbp_device(int vdev_fd __rte_unused,
 
 	RTE_LOG(DEBUG, PMD, "DPAA2: Added [dpbp.%d]\n", dpbp_id);
 
+	rte_mbuf_set_platform_mempool_ops(DPAA2_MEMPOOL_OPS_NAME);
+
 	return 0;
 }
 
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
index 9436d37..d421dbf 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
@@ -44,6 +44,8 @@
 /* Maximum release/acquire from QBMAN */
 #define DPAA2_MBUF_MAX_ACQ_REL	7
 
+#define DPAA2_MEMPOOL_OPS_NAME		"dpaa2"
+
 #define MAX_BPID 256
 #define DPAA2_MBUF_HW_ANNOTATION	64
 #define DPAA2_FD_PTA_SIZE		0
diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
index afda2c2..2bd62e8 100644
--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
@@ -354,7 +354,7 @@ rte_hw_mbuf_get_count(const struct rte_mempool *mp)
 }
 
 struct rte_mempool_ops dpaa2_mpool_ops = {
-	.name = "dpaa2",
+	.name = DPAA2_MEMPOOL_OPS_NAME,
 	.alloc = rte_hw_mbuf_create_pool,
 	.free = rte_hw_mbuf_free_pool,
 	.enqueue = rte_hw_mbuf_free_bulk,
-- 
2.7.4



More information about the dev mailing list