bus/dpaa: fix mempool ops registration
authorNipun Gupta <nipun.gupta@nxp.com>
Mon, 5 Feb 2018 05:21:55 +0000 (10:51 +0530)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 5 Feb 2018 23:40:29 +0000 (00:40 +0100)
Fixes: 2bd0d5b951a9 ("bus/dpaa: register platform HW mempool on runtime")

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: Shreyansh Jain <Shreyansh.jain@nxp.com>
drivers/bus/dpaa/dpaa_bus.c

index 1946bbe..290b967 100644 (file)
@@ -495,10 +495,16 @@ rte_dpaa_bus_probe(void)
                        ret = drv->probe(drv, dev);
                        if (ret)
                                DPAA_BUS_ERR("Unable to probe.\n");
+
                        break;
                }
        }
-       rte_mbuf_set_platform_mempool_ops(DPAA_MEMPOOL_OPS_NAME);
+
+       /* Register DPAA mempool ops only if any DPAA device has
+        * been detected.
+        */
+       if (!TAILQ_EMPTY(&rte_dpaa_bus.device_list))
+               rte_mbuf_set_platform_mempool_ops(DPAA_MEMPOOL_OPS_NAME);
 
        svr_file = fopen(DPAA_SOC_ID_FILE, "r");
        if (svr_file) {