From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0088.outbound.protection.outlook.com [104.47.41.88]) by dpdk.org (Postfix) with ESMTP id 33C67F94D for ; Thu, 19 Jan 2017 14:26:03 +0100 (CET) Received: from DM2PR03CA0039.namprd03.prod.outlook.com (10.141.96.38) by CY1PR0301MB0748.namprd03.prod.outlook.com (10.160.159.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.845.12; Thu, 19 Jan 2017 13:26:00 +0000 Received: from BN1BFFO11FD010.protection.gbl (2a01:111:f400:7c10::1:152) by DM2PR03CA0039.outlook.office365.com (2a01:111:e400:2428::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13 via Frontend Transport; Thu, 19 Jan 2017 13:26:00 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com;nxp.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD010.mail.protection.outlook.com (10.58.144.73) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.803.8 via Frontend Transport; Thu, 19 Jan 2017 13:25:57 +0000 Received: from bf-netperf1.idc ([10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v0JDO4fA015351; Thu, 19 Jan 2017 06:25:55 -0700 From: Hemant Agrawal To: CC: , , , , , , Hemant Agrawal Date: Thu, 19 Jan 2017 18:53:59 +0530 Message-ID: <1484832240-2048-35-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1484832240-2048-1-git-send-email-hemant.agrawal@nxp.com> References: <1484679174-4174-1-git-send-email-hemant.agrawal@nxp.com> <1484832240-2048-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131293059596687959; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(336005)(39850400002)(39410400002)(39380400002)(39840400002)(39450400003)(39860400002)(39400400002)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(105606002)(106466001)(50986999)(5003940100001)(85426001)(356003)(110136003)(38730400001)(2351001)(47776003)(92566002)(104016004)(626004)(76176999)(54906002)(33646002)(77096006)(68736007)(50466002)(8656002)(86362001)(36756003)(6916009)(81156014)(305945005)(2950100002)(8936002)(8676002)(4326007)(5660300001)(81166006)(97736004)(50226002)(189998001)(2906002)(53936002)(48376002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0301MB0748; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD010; 1:wcbIyNJ9DfuJQqBhcmrXsRkEis7NdvbqNnxajmoi/KDcbeX7/5RXyOlUcSoE/n2BNSkTXtCJEcIFeZTL035fLS4t+eetFjfuZqe9rZFx1i+eBBj8uPWUThkj5f5O621jcoeDUXhd/nsh/K1BxkGO4Knw1r5VE2ymRGzLR2xH3zNm1u0OhN5MBXOS9UuS4wamZzj8Dx+1TrQ78Sj3XIVQWSZHtB2+fEKKG1vm7IaDKGZql5+yYo3CjRV8unMaKc5905CQLT5wUwr6AJCsLWMcQDUZzVBrJBakJKwvKXVWjHJrbUZNHw2GmWrbfSBd6xBgPEo0YFIRT9jKyWy7QQykS0SNXsMC5bt1VgMWtuuJG8vsrMZEjaKadhFZqQjC4xRnjTFUL+/roe904Jj+DnVwmv9SAr4yaPJoaGdJhXK1ZvCNisqN/neB7OVvqLHlBGOLRrFW2NA2eMkgxo+QxImf4HNzrBvB9TooNPF97+O7m39WoRRdDGfBZRLCHMSmGNvvpgbPSpbV/p5QnslDZMlZHstiS+oOcehXrYGPVcy/L52dDjVT3EheHtfXhi4tTgiox5SIFnvw6gHFvne4gDFMg/xifXjncn1Fs/CyhHG2Q9db68uo9JutCW8IrctTNGbqGjnrzm7cbtII2IyzBpWjViD3vZuALQIrEAUG2C0NEgdoTDZNj3iYpK6JcEGYKtEAhin3kuoL3flYdaLN/FdWoH+72JQvb/0Oi7Ru1Ihiu0zupH424sMSrWXGxICAsETM MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 19460cf8-b2cd-4c95-b8fb-08d4406eb530 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:CY1PR0301MB0748; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0748; 3:8Tf7U1vHU8DeH2C9p5PGWBm9B2FBfjl1zxJsWkNcrsCG1iN4RvE+VNRCzyjdKT78Byu3uQDcXnN+NjNgKo0YHXrawhvuA6teA/NtxM5FAPze9sV5HJOUAvVcXi6WSjvFN3+vvbUOphDFqOO1jQi3wF6e5aoooFEW50TosGNlamQNJmTgWcJ8M76vXmb3Cw3eh1r9A9CvLJLoxlUIwdz2EIameoN/OKlXW7iEJbCsBK1WXMqjFAOFBP2j/SYwrumG3vSySD/bkKD3yW7YC7isB0bewSIDN1KpfUVIJeVPbKfJuUsUtkgj7lW24ffdiY+qC/LtTwwK4ioYXaJEBWt4B2lfDWqdvv//RTpkoIZWbbBVnv9n20O4koS5StK58GDC X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0748; 25:ougCoCJWfkZDeQTfPO+JglamimkQEsLYcp6n5Bpj7a0VAiDTNZpMu5u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soft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(13015025)(13017025)(13023025)(13018025)(13024025)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6096035)(20161123565025)(20161123563025)(20161123556025)(20161123561025)(20161123559025); SRVR:CY1PR0301MB0748; BCL:0; PCL:0; RULEID:(400006); SRVR:CY1PR0301MB0748; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0748; 4:j0TOZKqTr0Gh8Fuw1PH0Sjw8gsTqbRlN0Ty1ia2a46R5BAtqs6jUlvpBcUwzQX14KNZBc+R/vsfclDh2hAuCLfd4oNgGTtmsThiGrwHi13DF0CrB+KuqW6/wYwgP7hvixDVvE69goNM5uIIzD+5rzzVT/h335aBbxnCzkem1tcMAZ6R6cR8H0yTsyYLK14XKj91RxFV1DEep/b9X6Uri85u+KV4BJNFnsY+UkvwcWxOPHtws8FBEJKRB+/6k6elihVAoAnawjL5sK0BVIdHi0ZdgRB0nSdfybdpsMIha3DkGybs6Tnxh+tyarECC6d0SB7fNWVqS9yWjdcbG7XFtNymbwDhFYuepwjjtuHOyXdNG85D4gAK78JfRY0jLZRsQdi6IIvSRTLtvQq0NE40B71hS0WmMCCDieRhFYjnMmH+MNwMmZengaEp4xoJMpRCtKSVzM1LyBwhOa3bcistu/LlA6au2NexdFbpCJ4j5/70TWiBZ3L+Ekp6Bf+Zm4pSwWa08kowa1kYOBcnwq4FkAY7afsfsX2nZo25hKtdvHLWHHa/CpnY4QSxJ2RWBcASPUmZkPfiANfW1aT5b99uCLWueH/4Vb9lLEibzQCZ4Xo/NhUKQnMIZwhMLAIq7syI+ThH2hk5E0NrNKye9rr/OBM5Cp/LAneK2xxz0miFDYLQGPaF+gEvK+KXw5ZjTuDYtOUC55QDvWXJ6JIRtRv1drvDnXSdK7rNzrarrMT3urcIhxQJRo6+XXCYwdon7D+jk X-Forefront-PRVS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TrH1+z5l1bp1DCN0va8O/; 5:KvDfcm1JImvm+9s5vaatTYh94M33HWZdyezXlcQK98bJbktl3Z6XFy0ran1tapy2LvDndHHFMdj3fYCmj+IzXj1v4a088r3UqYjHll6IFQflvBF1gHYnBk+pPiDuptVZVbc6aK9NmFMdTmh9J72UjyakjISHkvvfuPtYNPS+BoHLHLE0IAX1EtLyEuqJkyUF; 24:tO/6ylNLXsvfXB6n3DgLhc/NQpmUO5e++Agj3TbmCDhAp6gQDxggD0Rfg+9NQ5ZsFBonLDFNryH0MRdwty7FLmj7ElDLt+E8qnxG1BqwrOA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0748; 7:QQZk18v3lQzPTS/XzeTyoqh7Piu31DMd+mRYb922g0W+A5M2Ug+YMVFecmDGbhYh7mxK8P5MxPIQMfGBpINz6VB3V8nzFIWogyYWkPIGEW7o8Z0eaVd9m7LR0kmCpbIir4N0JznRjA7ecKVIJ5XmoIiB2aTMkzfw6gXCsDH8kftGUO4SvMzKUY2OduFV/kFA2eoPKqA9wleHLtkgDhLSEjOY1wA/VUQTDTOWnfXwy6kQoBkrs8nKeVoco/xmtJelg0kbFviEejMMaVNDoh8BZZ0p2lYK43/sL9eHe2FSSk1nc2XDRqAJ4wH5H13OaVu00euw61MoaC3bbwvNoEhug3l4KG+ZGzXqfnaqiM2lGrsCo4F6a0eCF+hKzu6WLO3bOY+Yqa55mRCzULZcX/CDniZ+gfnVsRnKG0YD1T/hFeCbi/OCJfoFw1shoLuwSiBrUNRphDoHmDh6ol7qpUzubA== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2017 13:25:57.9996 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0301MB0748 Subject: [dpdk-dev] [PATCHv5 32/33] bus/fslmc: add support for dmamap to ARM SMMU 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: , X-List-Received-Date: Thu, 19 Jan 2017 13:26:04 -0000 Signed-off-by: Hemant Agrawal --- drivers/bus/fslmc/fslmc_vfio.c | 96 ++++++++++++++++++++++++++ drivers/bus/fslmc/fslmc_vfio.h | 1 + drivers/bus/fslmc/rte_pmd_fslmcbus_version.map | 1 + drivers/net/dpaa2/dpaa2_ethdev.c | 2 + 4 files changed, 100 insertions(+) diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c index 2bfd7fd..bea32b5 100644 --- a/drivers/bus/fslmc/fslmc_vfio.c +++ b/drivers/bus/fslmc/fslmc_vfio.c @@ -76,8 +76,10 @@ static struct fslmc_vfio_group vfio_groups[VFIO_MAX_GRP]; static struct fslmc_vfio_container vfio_containers[VFIO_MAX_CONTAINERS]; static int container_device_fd; +static uint32_t *msi_intr_vaddr; void *(*mcp_ptr_list); static uint32_t mcp_id; +static int is_dma_done; static int vfio_connect_container(struct fslmc_vfio_group *vfio_group) { @@ -147,6 +149,35 @@ static int vfio_connect_container(struct fslmc_vfio_group *vfio_group) return 0; } +static int vfio_map_irq_region(struct fslmc_vfio_group *group) +{ + int ret; + unsigned long *vaddr = NULL; + struct vfio_iommu_type1_dma_map map = { + .argsz = sizeof(map), + .flags = VFIO_DMA_MAP_FLAG_READ | VFIO_DMA_MAP_FLAG_WRITE, + .vaddr = 0x6030000, + .iova = 0x6030000, + .size = 0x1000, + }; + + vaddr = (unsigned long *)mmap(NULL, 0x1000, PROT_WRITE | + PROT_READ, MAP_SHARED, container_device_fd, 0x6030000); + if (vaddr == MAP_FAILED) { + FSLMC_VFIO_LOG(ERR, "Unable to map region (errno = %d)", errno); + return -errno; + } + + msi_intr_vaddr = (uint32_t *)((char *)(vaddr) + 64); + map.vaddr = (unsigned long)vaddr; + ret = ioctl(group->container->fd, VFIO_IOMMU_MAP_DMA, &map); + if (ret == 0) + return 0; + + FSLMC_VFIO_LOG(ERR, "VFIO_IOMMU_MAP_DMA fails (errno = %d)", errno); + return -errno; +} + int vfio_dmamap_mem_region(uint64_t vaddr, uint64_t iova, uint64_t size) @@ -170,6 +201,71 @@ int vfio_dmamap_mem_region(uint64_t vaddr, return 0; } +int fslmc_vfio_dmamap(void) +{ + int ret; + struct fslmc_vfio_group *group; + struct vfio_iommu_type1_dma_map dma_map = { + .argsz = sizeof(struct vfio_iommu_type1_dma_map), + .flags = VFIO_DMA_MAP_FLAG_READ | VFIO_DMA_MAP_FLAG_WRITE, + }; + + int i; + const struct rte_memseg *memseg; + + if (is_dma_done) + return 0; + is_dma_done = 1; + + for (i = 0; i < RTE_MAX_MEMSEG; i++) { + memseg = rte_eal_get_physmem_layout(); + if (memseg == NULL) { + FSLMC_VFIO_LOG(ERR, "Cannot get physical layout."); + return -ENODEV; + } + + if (memseg[i].addr == NULL && memseg[i].len == 0) + break; + + dma_map.size = memseg[i].len; + dma_map.vaddr = memseg[i].addr_64; +#ifdef RTE_LIBRTE_DPAA2_USE_PHYS_IOVA + dma_map.iova = memseg[i].phys_addr; +#else + dma_map.iova = dma_map.vaddr; +#endif + + /* SET DMA MAP for IOMMU */ + group = &vfio_groups[0]; + + if (!group->container) { + FSLMC_VFIO_LOG(ERR, "Container is not connected "); + return -1; + } + + FSLMC_VFIO_LOG(DEBUG, "-->Initial SHM Virtual ADDR %llX", + dma_map.vaddr); + FSLMC_VFIO_LOG(DEBUG, "-----> DMA size 0x%llX\n", dma_map.size); + ret = ioctl(group->container->fd, VFIO_IOMMU_MAP_DMA, + &dma_map); + if (ret) { + FSLMC_VFIO_LOG(ERR, "VFIO_IOMMU_MAP_DMA API" + "(errno = %d)", errno); + return ret; + } + FSLMC_VFIO_LOG(DEBUG, "-----> dma_map.vaddr = 0x%llX", + dma_map.vaddr); + } + + /* TODO - This is a W.A. as VFIO currently does not add the mapping of + * the interrupt region to SMMU. This should be removed once the + * support is added in the Kernel. + */ + vfio_map_irq_region(group); + + return 0; +} + static int64_t vfio_map_mcp_obj(struct fslmc_vfio_group *group, char *mcp_obj) { int64_t v_addr = (int64_t)MAP_FAILED; diff --git a/drivers/bus/fslmc/fslmc_vfio.h b/drivers/bus/fslmc/fslmc_vfio.h index 80c6869..7d562d3 100644 --- a/drivers/bus/fslmc/fslmc_vfio.h +++ b/drivers/bus/fslmc/fslmc_vfio.h @@ -70,6 +70,7 @@ int vfio_dmamap_mem_region( int fslmc_vfio_setup_group(void); int fslmc_vfio_process_group(void); +int fslmc_vfio_dmamap(void); /* create dpio device */ int dpaa2_create_dpio_device(struct fslmc_vfio_device *vdev, diff --git a/drivers/bus/fslmc/rte_pmd_fslmcbus_version.map b/drivers/bus/fslmc/rte_pmd_fslmcbus_version.map index 6937ad0..17befc7 100644 --- a/drivers/bus/fslmc/rte_pmd_fslmcbus_version.map +++ b/drivers/bus/fslmc/rte_pmd_fslmcbus_version.map @@ -49,6 +49,7 @@ DPDK_17.02 { dpseci_open; dpseci_reset; dpseci_set_rx_queue; + fslmc_vfio_dmamap; mcp_ptr_list; per_lcore__dpaa2_io; rte_fslmc_driver_register; diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 2cf395f..183b5b1 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -911,6 +911,8 @@ void dpaa2_dev_stats_reset(struct rte_eth_dev *dev) eth_dev->rx_pkt_burst = dpaa2_dev_rx; eth_dev->tx_pkt_burst = dpaa2_dev_tx; + fslmc_vfio_dmamap(); + return 0; } -- 1.9.1