bus/fslmc: check for DMA map in primary process only
authorShreyansh Jain <shreyansh.jain@nxp.com>
Thu, 29 Aug 2019 10:27:33 +0000 (15:57 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 8 Oct 2019 10:14:31 +0000 (12:14 +0200)
DMA mapping is a property of primary process - SMMU population done
once by primary doesn't need to be populated again in secondary

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Reviewed-by: Sachin Saxena <sachin.saxena@nxp.com>
drivers/bus/fslmc/fslmc_bus.c

index 8c155ac..e3f5248 100644 (file)
@@ -394,12 +394,15 @@ rte_fslmc_probe(void)
        /* Map existing segments as well as, in case of hotpluggable memory,
         * install callback handler.
         */
-       ret = rte_fslmc_vfio_dmamap();
-       if (ret) {
-               DPAA2_BUS_ERR("Unable to DMA map existing VAs: (%d)", ret);
-               /* Not continuing ahead */
-               DPAA2_BUS_ERR("FSLMC VFIO Mapping failed");
-               return 0;
+       if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
+               ret = rte_fslmc_vfio_dmamap();
+               if (ret) {
+                       DPAA2_BUS_ERR("Unable to DMA map existing VAs: (%d)",
+                                     ret);
+                       /* Not continuing ahead */
+                       DPAA2_BUS_ERR("FSLMC VFIO Mapping failed");
+                       return 0;
+               }
        }
 
        ret = fslmc_vfio_process_group();