From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0085.outbound.protection.outlook.com [104.47.40.85]) by dpdk.org (Postfix) with ESMTP id CE6ACFA68 for ; Mon, 23 Jan 2017 13:01:57 +0100 (CET) Received: from BN3PR03CA0097.namprd03.prod.outlook.com (10.174.66.15) by MWHPR03MB2478.namprd03.prod.outlook.com (10.169.200.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13; Mon, 23 Jan 2017 12:01:56 +0000 Received: from BN1AFFO11FD015.protection.gbl (2a01:111:f400:7c10::175) by BN3PR03CA0097.outlook.office365.com (2603:10b6:400:4::15) 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; Mon, 23 Jan 2017 12:01:56 +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 BN1AFFO11FD015.mail.protection.outlook.com (10.58.52.75) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.803.8 via Frontend Transport; Mon, 23 Jan 2017 12:01:55 +0000 Received: from bf-netperf1.idc ([10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v0NC07eu019311; Mon, 23 Jan 2017 05:01:53 -0700 From: Hemant Agrawal To: CC: , , , , , , Hemant Agrawal Date: Mon, 23 Jan 2017 17:30:02 +0530 Message-ID: <1485172803-17288-33-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1485172803-17288-1-git-send-email-hemant.agrawal@nxp.com> References: <1484832240-2048-1-git-send-email-hemant.agrawal@nxp.com> <1485172803-17288-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131296465161141652; (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)(39410400002)(39400400002)(39850400002)(39380400002)(39450400003)(39860400002)(39840400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(50226002)(5003940100001)(53936002)(6666003)(97736004)(8676002)(104016004)(6916009)(626004)(8936002)(85426001)(81156014)(81166006)(2950100002)(4326007)(68736007)(189998001)(36756003)(110136003)(5660300001)(92566002)(47776003)(33646002)(356003)(305945005)(2906002)(77096006)(86362001)(575784001)(8656002)(105606002)(106466001)(2351001)(38730400001)(50986999)(50466002)(48376002)(54906002)(76176999); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2478; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD015; 1:tEjYh388vHcItfAXdZq0UL3lfe0654FK8QwqYPzdRmEiglSVJk68j8DHAlsnpUn4PCBjjT+uXZxQh08jd5s5lcKPuppNdz1Av5+udxXF8T9zxkfXap38SSWUbMprA27hl8zo6heY4DWU2fhAWJs0cIZTgUlPjAI5jlsS8CUzxPO9QpYpdb3LrlZTyzYTb4KrDu9WmPIlrB25jEtraxG/5oSyhobDWmD/9FK5gNdGfjPXeLCmlDG9LJlHElUAQRkzxIHP729bJ/XZE8kULuL6k/lZwb5MBTTGOjEdAvSVfwzttCTJlTuT/s6py4X2m0JbhTjmgW1zlMgSPLGhL5y8j9RvZTDwdZRLUfp9wxyBayo0vvgC5pkzAV+AOP19XvxeEUg9DzMHiIaNi579OoVqtQqWIhJV427k1QDy6m86sodPm4OJ5jtsvYrn8VOinzSWYzEPAn1xoku2n+QQ2V6K0LL3+UNBXfTOVnNHqxZM8Gnt4XNIefIKhBvvaQJPKQlao3mZks7pTtWKxawdzQPSW7dZhkI60LtlxYxgCoHHAIaeqjmvElD0f+i3BOWgILrLwI7UCey1isDC4yfJd/ax+n73eajUkLpYfK16elW0+jiNSlLpiy4x3RnwrsCNdNnrHPk6vlRL/gJFsY9kYkv+gFi3amr0Fd59fNfQuidmtqVddaQqtWVQ3GEZcxFfwoc5AkVMvFVi2EHkjwd9ZejsxFFfEXDXY2RRIF3g7Mlq4BCucvNYE3tXmSBX+xoDUuMH MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: e45df4f6-9394-4b24-bd94-08d44387a0a8 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:MWHPR03MB2478; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2478; 3:CTvjMJ1AoZOq2j8lhEV/ZMvIft6zTUQySME0jCLe0/hQMpnZvtqW2C5UWkZ1R93QYv6uBmfA+YIjyTKv0JNg6P6tKiO8p0u4v2Y4u5MwYVkDY4+Mka5YoyeifTRWNiWlYaxq7TzZBVR0RFKmXxWW3OLn8aHE3nZevKvRrU4j69K0fiOf23AhQaIS2IcA5PtF2tKcU2zBz14XLHOFy7T1u11KOhRDBMWr74lWvVfU5pXcB29ZGQGjvnCHdTUL2UV6D+SZqDryFBfK3UlLVGCxwf7dHxlkqslLO0vw472nfJDp+r9yAnywiP42Rl2JcZtvW07H7Rc86kS2UuZU87mzoPawck2ewXEGeaU49UCM0Y9CVbF63rDhZcaSpFLl60t0; 25:WI8aRPyUj94+t5cTYoOCYMf4g0swYFxH2QQlh3JJjht37onhECrhQZl2ZEOyWUJ5hsSNiCgVhUHyQq4j6AMN9q3zjBL813kkhzF+qtqNbqnXXBfom5TDcvu0uS9wOTTi1SGg+xxPYlpxFnlvmzqV/VWbNBeLYIwKf4MzqYAwT70cFceWAbXsutk/EJ85ELeh1WAO6oxoMS4c09iUgFxjWjcgZ5SyTlnR70kyQTVhMDBlb9H9+IQNjxRpChFhvJhVgdP4rUu/i6ADqz9DzhTWWGD7aGoiYHKZ+KkSLg31UcKDz+4ij9fW8yf4y4pDFIrDNbZamZFTUBc07sMATi8ap97mI9heF2XAim0sf5lZ6k0QnyPM3kbWTc7qmcyghhAGFOJMxXNra/V95t2FXleOTpLsoYSXwTcQcWPTP8kBez2KReYKZHWsZ4qSoIkFkM2Zex4i4epfErni9ogP2htdsQ== X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2478; 31:eFiT2K9mXjnr64RFVFT19pmyi1uKa/02euE8P6/2tsBiDM+2bfqplZJjG1MXzS2fvRt5LRfjl80r9FGUHf5aJ3yJy/w45XSPMWTX54IdBQBLYHDUxNSfm6CIwf6O6C8TevZHmUlRKjRSZlmb7F5BF77rZh8FbuCrxZZj8hehYzHrV6HL85N2nMUaE2xD402v0p2dMwzdL45oIV9tQvqLaZJi9LQIjxwRV3V1i7pXtUoYb+15V52Veck74P+eMeQPG5e+kWlZWLf+iRslMPWRhpsjVSAHpkRdjAE8qIcM9V4= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(13023025)(13017025)(13015025)(13024025)(13018025)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6096035)(20161123561025)(20161123559025)(20161123556025)(20161123563025)(20161123565025); SRVR:MWHPR03MB2478; BCL:0; PCL:0; RULEID:(400006); SRVR:MWHPR03MB2478; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2478; 4:ls/dy2DGSI3Y2iGTNl5pQyAbnJGHxHivxdG3qp8PEHLByOVR6rkmoHqIhqo77peUaRwojjX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nosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2478; 7:hU1WOPzzO6smPM3gPKyGpEp6/NhgKehln2X/Xav1QSwnJpQUk6QcUyxakYPdZ55X1nUO6xtFwWw42XUpI6Kov7HijU38BIFH7dePK+8qLFUdOmra0GLO/B2isx8QZc8YqoDwjKxzpa+vtaqQHdht+uyLf9kpp306gv6PL76RBbn+RAIUcV3SSfImsOkBs6RL3JACHnmR+wQAbGhoBKqZ9JdeDbZIg0ge8PnJd2N5LvLijOQCQJW8nxFQiUzzAp16nz8hVOwI0tVTqGeuwtKBTEc6aZxj1XxYXoXH1jEi3AuKpKM3tFasMcr2GHWN5UrLNx+/l8lNQCe3QQ/5HD++0isVZlCNYT+yGrSNH2Jyxncj5GgiCnUt0CpihA+YvaAGdk7ViZB4NmyYsgm5Qfv07VhLERMVyhSzbUGwNJ9fVHxlPf6EkZtacP7THbL64y535tcaghHwizE2JU5SfuVUIQ== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jan 2017 12:01:55.9269 (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: MWHPR03MB2478 Subject: [dpdk-dev] [PATCHv6 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: Mon, 23 Jan 2017 12:01:58 -0000 Signed-off-by: Hemant Agrawal --- drivers/bus/fslmc/fslmc_vfio.c | 96 +++++++++++++++++++++++++++++ drivers/bus/fslmc/fslmc_vfio.h | 1 + drivers/bus/fslmc/rte_bus_fslmc_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 fc017fc..5f1d1b7 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 *(*rte_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 rte_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..53dd0b7 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 rte_fslmc_vfio_dmamap(void); /* create dpio device */ int dpaa2_create_dpio_device(struct fslmc_vfio_device *vdev, diff --git a/drivers/bus/fslmc/rte_bus_fslmc_version.map b/drivers/bus/fslmc/rte_bus_fslmc_version.map index 4a8f478..505873a 100644 --- a/drivers/bus/fslmc/rte_bus_fslmc_version.map +++ b/drivers/bus/fslmc/rte_bus_fslmc_version.map @@ -52,6 +52,7 @@ DPDK_17.02 { per_lcore__dpaa2_io; rte_fslmc_driver_register; rte_fslmc_driver_unregister; + rte_fslmc_vfio_dmamap; rte_mcp_ptr_list; local: *; diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 6609a9b..cbfbc7a 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -910,6 +910,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; + rte_fslmc_vfio_dmamap(); + return 0; } -- 1.9.1