From 0ad49b2083921a59eecf97dabcb820e95b259a09 Mon Sep 17 00:00:00 2001 From: Ashwin Sekhar T K Date: Thu, 8 Apr 2021 15:20:42 +0530 Subject: [PATCH] mempool/cnxk: register plt init callback Register the CNXk mempool plt init callback which will set the appropriate mempool ops to be used for the platform. Signed-off-by: Ashwin Sekhar T K --- drivers/mempool/cnxk/cnxk_mempool_ops.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/mempool/cnxk/cnxk_mempool_ops.c b/drivers/mempool/cnxk/cnxk_mempool_ops.c index 2ce1816c04..e8f64be76b 100644 --- a/drivers/mempool/cnxk/cnxk_mempool_ops.c +++ b/drivers/mempool/cnxk/cnxk_mempool_ops.c @@ -2,6 +2,7 @@ * Copyright(C) 2021 Marvell. */ +#include #include #include "roc_api.h" @@ -169,3 +170,17 @@ cnxk_mempool_populate(struct rte_mempool *mp, unsigned int max_objs, mp, RTE_MEMPOOL_POPULATE_F_ALIGN_OBJ, max_objs, vaddr, iova, len, obj_cb, obj_cb_arg); } + +static int +cnxk_mempool_plt_init(void) +{ + if (roc_model_is_cn10k() || roc_model_is_cn9k()) + rte_mbuf_set_platform_mempool_ops("cnxk_mempool_ops"); + + return 0; +} + +RTE_INIT(cnxk_mempool_ops_init) +{ + roc_plt_init_cb_register(cnxk_mempool_plt_init); +} -- 2.20.1