From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0074.outbound.protection.outlook.com [104.47.36.74]) by dpdk.org (Postfix) with ESMTP id CB366F958 for ; Thu, 29 Dec 2016 06:16:01 +0100 (CET) Received: from BLUPR0301CA0001.namprd03.prod.outlook.com (10.162.113.139) by BN1PR0301MB0739.namprd03.prod.outlook.com (10.160.78.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.817.10; Thu, 29 Dec 2016 05:16:01 +0000 Received: from BL2FFO11FD024.protection.gbl (2a01:111:f400:7c09::127) by BLUPR0301CA0001.outlook.office365.com (2a01:111:e400:5259::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.817.10 via Frontend Transport; Thu, 29 Dec 2016 05:16:01 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) 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.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BL2FFO11FD024.mail.protection.outlook.com (10.173.161.103) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.789.10 via Frontend Transport; Thu, 29 Dec 2016 05:16:00 +0000 Received: from Tophie.ap.freescale.net ([10.232.14.87]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id uBT5DOIE010218; Wed, 28 Dec 2016 22:15:57 -0700 From: Shreyansh Jain To: CC: , , , , , Hemant Agrawal Date: Thu, 29 Dec 2016 10:46:51 +0530 Message-ID: <1482988612-6638-33-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1482988612-6638-1-git-send-email-shreyansh.jain@nxp.com> References: <1482180853-18823-1-git-send-email-hemant.agrawal@nxp.com> <1482988612-6638-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131274621609569735; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.158.2; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(7916002)(39450400003)(39850400002)(39860400002)(39380400002)(39840400002)(39400400002)(39410400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(104016004)(68736007)(5660300001)(86362001)(110136003)(305945005)(50986999)(92566002)(76176999)(69596002)(6666003)(6916009)(2950100002)(38730400001)(77096006)(8676002)(356003)(8936002)(81166006)(50226002)(626004)(81156014)(8656002)(50466002)(2906002)(33646002)(105606002)(5003940100001)(85426001)(4326007)(36756003)(48376002)(106466001)(2351001)(189998001)(97736004)(47776003)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR0301MB0739; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD024; 1:YbGA50193Vf68RRXHIDblYBza0v6w8baLns+DXcovmu/OkRPUbnzExuWeJSlGSh6NoKPIz6uUyRjvPl7TtC0l+hfLxJqyjkWdiGY0/oEo7IfZX9l96FCIf6kgZqdj/k3GZeu1Gh8x8lVDabIo7jgpn75zg6XwDbK+c5F3OzyMCxogYcHVuH8KHbJXtjcPM0E6hca/cLIDVkET1Fsb1ihMq5xy66oc0QujCMhpAvlv2AmOkOkNLNIX5+26L9e87RsoQewph+tLjcUeCcefkWDnNC0te28dOqEGt3auxmvKJOD8WLooZVMtcOGO53ooNZL4No6O06kzZWeD4wXiGdRmbHCtmm19wUhfKRtiwstUoSvHKs7k9ctFARho15UCTF72osfScjqUBdp0fhtTEBEyZOZMEsp5cyRF7o96xnriC2jSJQMEtpGVSRkeI/jZzSbiaRIsd8a5tEPg6BOhboO0Vv+13k4qmXFoQwbTPRZ5cP3KrGV89571Ny1ndz5wLgrfbHTJbgjh1VsO21KCX8DStfjqxPoHP+M8Ibvz2j2bSkpOLY4u8U8MFBaAkg9JmiFNO0q4zeeQpll/WCROzdU4zooWICF+y3BxFnLnj0EFfqici68YX0b3V0XINV/tAYfVh0GzpzvmLABR/G4IuASJ+fHJ/Qp0U9Q/yW7o4eq4OT85838MGOrSwZZFnM9gfhiRi/WuM6j2B1m7cy64mH/P+ioLSGhzoIy7r6mscZoV54OKWBDHsuMQ17K1DHUSYfuHIeICx7h/Rr9AAVP51JiaQ== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 0e334f3f-8a54-4600-8167-08d42fa9c771 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN1PR0301MB0739; X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0739; 3:3WoMydInMSi9KltNZUCe6X2lIYJ7/YRRi+sgh5rrZDjzzj0AVLBbQ4ZkNqQQRtJ7c5phhlBG5iYqNRUMK+szoMiL4WWYofwr54dlAnk2xrP3xVWYu9gfDXYv3ImvBzn3mXCTFbOFo7AE2GCVkrGyGYV8ZFWSaCjRtqa0uPS1xIuQVV5tOQdWvIE6zPYOo6ApWz/ifEYOZxfTTpNsZIk8CB6sYtXOmuyJgh7aSUqSwDhsHQpZJSB/kAv9qif8ClS1/+Ga1qlVRzwjTs4Puwsl1IPB8aAcbZ027bYbAbozqBIa6R0/DI8JJU8yDoUVyDj+0ScykO0Aie6NP3dEQCUR2xXHQDIE2XW+lBrjp3/hBo0= X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0739; 25:dbffOH72xDa8JjmysoCQaVSaNWOVrdAykhd3Xtwmt53bCKahnu0qANdpKIiT1wkxn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: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(13024025)(13023025)(13015025)(13017025)(13018025)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6096035)(20161123561025)(20161123559025)(20161123556025)(20161123565025)(20161123563025); SRVR:BN1PR0301MB0739; BCL:0; PCL:0; RULEID:(400006); SRVR:BN1PR0301MB0739; X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0739; 4:rhwEk+V2Y/IeXTRSS99RmdNb+uuzUgk+JJxscySG8McwWxDF9ETxUSNAS3dOaDYIIwa6JiN+tz9xVQo5esHQmILmGD/8Zd23G/e2T/nmn/hoJj09dETvI0Ts/+aWVWA9AYqGw84rReVGX0cEIoU+ASRCwrihwqBAtZtmc8vu0bBuGtoazmIdwwn4r9gupYZYWuzTLDm9Gic2bSe4WKQNGOVtHCcGTHgdTdWJeTrsq4TSbLkjjkIWJ+4TEZUXsjMSVH5FsNUfn8DwPzIwqg7ukZADsWTaxuCn/0GNmvzIHoV3DvzdoGwbgycwBS1xgi8/a1oLs40qo1Bos8U9cEAqACRTqJ94QgmQxIo2xKNUC9Q7DbZTYSFpyGKr2x0YSSKKjlpeVNF0sryGKDf4dv5kdqQIDg2nZrJHZBFejOXTCw16QmeiPWydF9mL1AF7REpd+HP7H78qrbko9ANG/NxL4ZQ4SCNCl3LNyomlphrB/r8fhCqZ3J4lT1UPGCTE26x7yz6B9s5j04B+pyyvArb0Qjztjv6DS6WERsLxJbPlShYPds4AaDUbB9C7d5eUVfTT/+4UlSM7it3SjFrsX9O7ogv5kzg6wLrxSxwBWrxKrDr2FU3lET1+bfus/qZ5qIPjviqM71h6MuDotQOhdup0czCkZnHD1Qa2bVb2UdD42eVeZWsaEmG10vbgXIdlYwnBS263YYdOFVVsbrPrmmkSxOX+2hRM5SXX78WgCF4rYfM0IwGOY43lXgC/4H13V7p8 X-Forefront-PRVS: 01713B2841 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN1PR0301MB0739; 23:DlllH0WblwPN5eLDOY2W2DijYRx5xSM3U46YyyY?= =?us-ascii?Q?zdjd3iHpZgLz6MljiGu5RGbcALgTKbzTsvu65aUfcLDPRJnbuBD4fIHIw3a2?= =?us-ascii?Q?DgXf25ilqOkj44xfcK4mRhqivpfyHvOL5CP1auFwk3NZHRRyMgVDJGhN0lRg?= =?us-ascii?Q?X5MABAKDmy2PRD2ilj1M0q8FPykd/SASvcOreB171z6NP8ggvS43Gw38zD9B?= =?us-ascii?Q?Zp7Sq1P8lVDTMbGEqAAwUXsAS7D2+THXmrc7M53byBBdnyLQfExgLbTfN+ar?= =?us-ascii?Q?EkFH9eiQZtfGQv8st9AAYDG83nRWoczel8TSW/Kdkd0FnvRzw8uKNQgvVEtq?= =?us-ascii?Q?oqfoqj4cPeW2lkiq2KE3spoMv7usTN7IQrKmLROtjfdzGwDwERaY6PD65k8P?= =?us-ascii?Q?s487L1WIADNkDV32TDtIjxW1XB2IZxF5Y9q5DQGsF54zbGFj5HS2zyk89K5X?= =?us-ascii?Q?LRqlD3GbEiAqXxbWHzXgnkwQWhlC6qGytQg+8JtYQKqtzrArb095497RXyl0?= =?us-ascii?Q?e9bizV7QHJRPbCPsTylhKfqW+tqaAC/7G0VK/BO3KhzOBZqZgri6bA+Q9Kji?= =?us-ascii?Q?22GMdBnHdLk37RGrxoZlDVQsTSwqZ4H5suaX2BWnClYQwC2jOA9GEJUcUdwy?= =?us-ascii?Q?3TCWyJqczW/lto/JDWOLndE5RtPuVlBHLuIatAYZvDhtsS53nYHJP1ZKOnxw?= =?us-ascii?Q?ti58D61kYmEbUGq0JCzC34/HZSLNE4UP178HEEFO4zqY8eGQGb1MvLZZzWhl?= =?us-ascii?Q?wYz7nD7N8BaEHfqnXq5ubMIpKM2U6kl+CBzeBaPBeb14mFmvSfb80mzoCRuv?= =?us-ascii?Q?eRK99dULHYGm1MRzf7n5mI4WfxgZ2+aAewou7B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Ag3tic/; 5:1o7fdprKxFwBnQC+plQTo8v0yX7SHhlfMrYzRD91h2PzaaS0x7JFPutiiArXoR5WVVhU5rl9PTzgvXRIyqT3FG1rBGbu9XCfkrGP8VjM0PJbYtE52wOqQ2Dt8mn0Cm2do6jMHBb5TdwxAji71wEELjOmd3p5va6s+lImqzsZ8DziXSTlt8OaFYr1pROwy93P; 24:52Jbs5Exqca0OgU32swz3V3HBUcRr0EjWPdN3zljTJiLUAM59711SfNcfn5BB/tkg4zj3mQB8gwxJSUeqrHjCWDp2f4i4F30e005DIO4TuY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0739; 7:C/s6TkcLaOw3mON/a2fZWM5jibduLZUokyUkv43dOVHxq4DNJ0cXU8rd3hF0/qdKTDADwbsQ0ouBqz8qIiuQYYcZceRmOsXVYQxl/4bd272D1U7BJ7J6RTi0j1eOhngVldzOo0Fo6A7+2XV0uDYzHxxNwKRstWUsVj4+hOgBxwkib4CJF245jIJc+FevHk4JbXqgrNjQ14ZVJ9ymyPwglt+ICDfcem0Op6dVYlwPcK8y4zmxtMOUKMP7tvskQxYIgITo76V2P9cROW+ZTJHcM5xM4/fmyOJRY8ly1enngRXWPPDR/SJoZBD0i1wggYjG2VP8GNnYxTBNkq+RuYuNna2QeKlD75jlOQdktc5InY5ap3l8EvlP0CCNflxLjDlurqUyeTTs149RcuUE83ruZjAoyEuHAxHvSx/4l51BZq3ydfSpbpRm9v2NhAKcwLsDG716Caqf9Fzkgzle0fxA+A== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Dec 2016 05:16:00.5981 (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.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN1PR0301MB0739 Subject: [dpdk-dev] [PATCH v3 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, 29 Dec 2016 05:16:02 -0000 From: Hemant Agrawal Signed-off-by: Hemant Agrawal --- drivers/bus/fslmc/fslmc_vfio.c | 97 ++++++++++++++++++++++++++ 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, 101 insertions(+) diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c index 4e47ec8..b9598ae 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) @@ -169,6 +200,72 @@ 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 9bf69d4..85fb70b 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(struct rte_bus *bus); +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 d1456d5..3a90e7c 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -911,6 +911,8 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) eth_dev->rx_pkt_burst = dpaa2_dev_rx; eth_dev->tx_pkt_burst = dpaa2_dev_tx; + fslmc_vfio_dmamap(); + return 0; } -- 2.7.4