raw/cnxk_bphy: support telemetry
[dpdk.git] / drivers / mempool / cnxk / cnxk_mempool_ops.c
index 2ce1816..c7b75f0 100644 (file)
@@ -2,6 +2,7 @@
  * Copyright(C) 2021 Marvell.
  */
 
+#include <rte_mbuf_pool_ops.h>
 #include <rte_mempool.h>
 
 #include "roc_api.h"
@@ -169,3 +170,22 @@ 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)
+{
+       int rc = 0;
+
+       if (roc_model_is_cn9k()) {
+               rte_mbuf_set_platform_mempool_ops("cn9k_mempool_ops");
+       } else if (roc_model_is_cn10k()) {
+               rte_mbuf_set_platform_mempool_ops("cn10k_mempool_ops");
+               rc = cn10k_mempool_plt_init();
+       }
+       return rc;
+}
+
+RTE_INIT(cnxk_mempool_ops_init)
+{
+       roc_plt_init_cb_register(cnxk_mempool_plt_init);
+}