summaryrefslogtreecommitdiff
path: root/drivers/bus/fslmc
diff options
context:
space:
mode:
authorHemant Agrawal <hemant.agrawal@nxp.com>2018-01-29 13:40:49 +0530
committerThomas Monjalon <thomas@monjalon.net>2018-01-29 19:02:05 +0100
commit8824b74d8f5ff84e5b71bf964570437bf2c5d7cf (patch)
tree5643c0c2c1be1c0778a4c72bed0602173cc7b837 /drivers/bus/fslmc
parent2bd0d5b951a92ce1be828f6614a27197b30e1e07 (diff)
downloaddpdk-8824b74d8f5ff84e5b71bf964570437bf2c5d7cf.zip
dpdk-8824b74d8f5ff84e5b71bf964570437bf2c5d7cf.tar.gz
dpdk-8824b74d8f5ff84e5b71bf964570437bf2c5d7cf.tar.xz
bus/fslmc: register platform HW mempool on runtime
Detect if the DPAA2 mempool objects are present and register it as platform default hw mempool Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Diffstat (limited to 'drivers/bus/fslmc')
-rw-r--r--drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c7
-rw-r--r--drivers/bus/fslmc/portal/dpaa2_hw_pvt.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c
index 139249c..1539739 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>
@@ -38,6 +39,7 @@ dpaa2_create_dpbp_device(int vdev_fd __rte_unused,
{
struct dpaa2_dpbp_dev *dpbp_node;
int ret;
+ static int register_once;
/* Allocate DPAA2 dpbp handle */
dpbp_node = rte_malloc(NULL, sizeof(struct dpaa2_dpbp_dev), 0);
@@ -74,6 +76,11 @@ dpaa2_create_dpbp_device(int vdev_fd __rte_unused,
RTE_LOG(DEBUG, PMD, "DPAA2: Added [dpbp.%d]\n", dpbp_id);
+ if (!register_once) {
+ if (rte_mbuf_set_platform_mempool_ops(DPAA2_MEMPOOL_OPS_NAME))
+ register_once = 1;
+ }
+
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