devtools: fix build check for whether meson has run
[dpdk.git] / drivers / bus / dpaa / dpaa_bus.c
index 138e0f9..204a50b 100644 (file)
@@ -34,6 +34,7 @@
 
 #include <rte_dpaa_bus.h>
 #include <rte_dpaa_logs.h>
+#include <dpaax_iova_table.h>
 
 #include <fsl_usd.h>
 #include <fsl_qman.h>
@@ -46,7 +47,7 @@ int dpaa_logtype_mempool;
 int dpaa_logtype_pmd;
 int dpaa_logtype_eventdev;
 
-struct rte_dpaa_bus rte_dpaa_bus;
+static struct rte_dpaa_bus rte_dpaa_bus;
 struct netcfg_info *dpaa_netcfg;
 
 /* define a variable to hold the portal_key, once created.*/
@@ -541,6 +542,10 @@ rte_dpaa_bus_probe(void)
        unsigned int svr_ver;
        int probe_all = rte_dpaa_bus.bus.conf.scan_mode != RTE_BUS_SCAN_WHITELIST;
 
+       /* If DPAA bus is not present nothing needs to be done */
+       if (TAILQ_EMPTY(&rte_dpaa_bus.device_list))
+               return 0;
+
        svr_file = fopen(DPAA_SOC_ID_FILE, "r");
        if (svr_file) {
                if (fscanf(svr_file, "svr:%x", &svr_ver) > 0)
@@ -548,6 +553,9 @@ rte_dpaa_bus_probe(void)
                fclose(svr_file);
        }
 
+       /* And initialize the PA->VA translation table */
+       dpaax_iova_table_populate();
+
        /* For each registered driver, and device, call the driver->probe */
        TAILQ_FOREACH(dev, &rte_dpaa_bus.device_list, next) {
                TAILQ_FOREACH(drv, &rte_dpaa_bus.driver_list, next) {
@@ -555,6 +563,9 @@ rte_dpaa_bus_probe(void)
                        if (ret)
                                continue;
 
+                       if (rte_dev_is_probed(&dev->device))
+                               continue;
+
                        if (!drv->probe ||
                            (dev->device.devargs &&
                            dev->device.devargs->policy == RTE_DEV_BLACKLISTED))
@@ -579,8 +590,7 @@ rte_dpaa_bus_probe(void)
        /* 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);
+       rte_mbuf_set_platform_mempool_ops(DPAA_MEMPOOL_OPS_NAME);
 
        return 0;
 }
@@ -617,7 +627,7 @@ rte_dpaa_get_iommu_class(void)
        return RTE_IOVA_PA;
 }
 
-struct rte_dpaa_bus rte_dpaa_bus = {
+static struct rte_dpaa_bus rte_dpaa_bus = {
        .bus = {
                .scan = rte_dpaa_bus_scan,
                .probe = rte_dpaa_bus_probe,