From patchwork Thu May 2 07:43:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yongseok Koh X-Patchwork-Id: 53203 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 5F6FB29D2; Thu, 2 May 2019 09:44:04 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 735ED2986 for ; Thu, 2 May 2019 09:44:02 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE2 (envelope-from yskoh@mellanox.com) with ESMTPS (AES256-SHA encrypted); 2 May 2019 10:44:01 +0300 Received: from scfae-sc-2.mti.labs.mlnx (scfae-sc-2.mti.labs.mlnx [10.101.0.96]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x427hwVi009791; Thu, 2 May 2019 10:43:59 +0300 From: Yongseok Koh To: ferruh.yigit@intel.com, anatoly.burakov@intel.com, thomas@monjalon.net, shahafs@mellanox.com Cc: dev@dpdk.org, stable@dpdk.org Date: Thu, 2 May 2019 00:43:56 -0700 Message-Id: <20190502074357.32031-1-yskoh@mellanox.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190502014436.40545-1-yskoh@mellanox.com> References: <20190502014436.40545-1-yskoh@mellanox.com> Subject: [dpdk-dev] [PATCH v2 1/2] bus/pci: add Mellanox kernel driver type 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" Mellanox mlx4/5 PMD doesn't need to be detached from kernel driver and attached to VFIO/UIO. Control path still goes through the existing kernel drivers, which is mlx4_core/mlx5_core. Cc: stable@dpdk.org Signed-off-by: Yongseok Koh --- v2: * add RTE_KDRV_NIC_MLX drivers/bus/pci/linux/pci.c | 6 +++++- lib/librte_eal/common/include/rte_dev.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/bus/pci/linux/pci.c b/drivers/bus/pci/linux/pci.c index c99d523f0a..b931cf9d10 100644 --- a/drivers/bus/pci/linux/pci.c +++ b/drivers/bus/pci/linux/pci.c @@ -329,6 +329,9 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr) dev->kdrv = RTE_KDRV_IGB_UIO; else if (!strcmp(driver, "uio_pci_generic")) dev->kdrv = RTE_KDRV_UIO_GENERIC; + else if (!strcmp(driver, "mlx4_core") || + !strcmp(driver, "mlx5_core")) + dev->kdrv = RTE_KDRV_NIC_MLX; else dev->kdrv = RTE_KDRV_UNKNOWN; } else @@ -568,7 +571,8 @@ pci_one_device_has_iova_va(void) FOREACH_DRIVER_ON_PCIBUS(drv) { if (drv && drv->drv_flags & RTE_PCI_DRV_IOVA_AS_VA) { FOREACH_DEVICE_ON_PCIBUS(dev) { - if (dev->kdrv == RTE_KDRV_VFIO && + if ((dev->kdrv == RTE_KDRV_VFIO || + dev->kdrv == RTE_KDRV_NIC_MLX) && rte_pci_match(drv, dev)) return 1; } diff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h index 56dd52ad9e..a17023d88b 100644 --- a/lib/librte_eal/common/include/rte_dev.h +++ b/lib/librte_eal/common/include/rte_dev.h @@ -63,6 +63,7 @@ enum rte_kernel_driver { RTE_KDRV_VFIO, RTE_KDRV_UIO_GENERIC, RTE_KDRV_NIC_UIO, + RTE_KDRV_NIC_MLX, RTE_KDRV_NONE, }; From patchwork Thu May 2 07:43:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yongseok Koh X-Patchwork-Id: 53204 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 32C0B29AC; Thu, 2 May 2019 09:44:13 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id BF66F29CB for ; Thu, 2 May 2019 09:44:11 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE2 (envelope-from yskoh@mellanox.com) with ESMTPS (AES256-SHA encrypted); 2 May 2019 10:44:10 +0300 Received: from scfae-sc-2.mti.labs.mlnx (scfae-sc-2.mti.labs.mlnx [10.101.0.96]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x427hwVj009791; Thu, 2 May 2019 10:44:08 +0300 From: Yongseok Koh To: ferruh.yigit@intel.com, anatoly.burakov@intel.com, thomas@monjalon.net, shahafs@mellanox.com Cc: dev@dpdk.org, stable@dpdk.org Date: Thu, 2 May 2019 00:43:57 -0700 Message-Id: <20190502074357.32031-2-yskoh@mellanox.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190502074357.32031-1-yskoh@mellanox.com> References: <20190502014436.40545-1-yskoh@mellanox.com> <20190502074357.32031-1-yskoh@mellanox.com> Subject: [dpdk-dev] [PATCH v2 2/2] net/mlx: support IOVA VA mode 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" Set RTE_PCI_DRV_IOVA_AS_VA to driver's drv_flags as device's IOMMU takes virtual address. Cc: stable@dpdk.org Signed-off-by: Yongseok Koh --- v2: * add RTE_KDRV_NIC_MLX drivers/net/mlx4/mlx4.c | 4 ++-- drivers/net/mlx5/mlx5.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index fe559c0407..eccb77b410 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -1133,8 +1133,8 @@ static struct rte_pci_driver mlx4_driver = { }, .id_table = mlx4_pci_id_map, .probe = mlx4_pci_probe, - .drv_flags = RTE_PCI_DRV_INTR_LSC | - RTE_PCI_DRV_INTR_RMV, + .drv_flags = RTE_PCI_DRV_INTR_LSC | RTE_PCI_DRV_INTR_RMV | + RTE_PCI_DRV_IOVA_AS_VA, }; #ifdef RTE_IBVERBS_LINK_DLOPEN diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index de85e85300..ecab7f899f 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -2101,8 +2101,8 @@ static struct rte_pci_driver mlx5_driver = { .remove = mlx5_pci_remove, .dma_map = mlx5_dma_map, .dma_unmap = mlx5_dma_unmap, - .drv_flags = (RTE_PCI_DRV_INTR_LSC | RTE_PCI_DRV_INTR_RMV | - RTE_PCI_DRV_PROBE_AGAIN), + .drv_flags = RTE_PCI_DRV_INTR_LSC | RTE_PCI_DRV_INTR_RMV | + RTE_PCI_DRV_PROBE_AGAIN | RTE_PCI_DRV_IOVA_AS_VA, }; #ifdef RTE_IBVERBS_LINK_DLOPEN