[v1,26/30] bus/fslmc: check for Dma map in primary process only

Message ID 20190827070730.11206-27-sachin.saxena@nxp.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series Enhancements and fixes in NXP dpaax drivers and fsl-mc bus |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Sachin Saxena Aug. 27, 2019, 7:07 a.m. UTC
  From: Shreyansh Jain <shreyansh.jain@nxp.com>

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 | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)
  

Patch

diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c
index aa90d686f..9226d5b62 100644
--- a/drivers/bus/fslmc/fslmc_bus.c
+++ b/drivers/bus/fslmc/fslmc_bus.c
@@ -395,12 +395,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();