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>
This commit is contained in:
Hemant Agrawal 2018-01-29 13:40:49 +05:30 committed by Thomas Monjalon
parent 2bd0d5b951
commit 8824b74d8f
4 changed files with 10 additions and 2 deletions

View File

@ -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
#

View File

@ -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;
}

View File

@ -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

View File

@ -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,