From patchwork Thu Aug 29 10:27:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Saxena X-Patchwork-Id: 58276 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2DC7D1E8DA; Thu, 29 Aug 2019 12:43:17 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 9C3861DFE3 for ; Thu, 29 Aug 2019 12:42:01 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 813DB20076B; Thu, 29 Aug 2019 12:42:01 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 7FB9A20075C; Thu, 29 Aug 2019 12:41:59 +0200 (CEST) Received: from GDB1.ap.freescale.net (GDB1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 737B5402EB; Thu, 29 Aug 2019 18:41:56 +0800 (SGT) From: Sachin Saxena To: dev@dpdk.org Cc: thomas@monjalon.net, Shreyansh Jain Date: Thu, 29 Aug 2019 15:57:33 +0530 Message-Id: <20190829102737.13267-27-sachin.saxena@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190829102737.13267-1-sachin.saxena@nxp.com> References: <20190827070730.11206-1-sachin.saxena@nxp.com> <20190829102737.13267-1-sachin.saxena@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v2 26/30] bus/fslmc: check for Dma map in primary process only X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Shreyansh Jain 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 Reviewed-by: Sachin Saxena --- drivers/bus/fslmc/fslmc_bus.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) 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();