From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id EC2A5A00E6 for ; Mon, 8 Jul 2019 16:24:41 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BEA3E4C94; Mon, 8 Jul 2019 16:24:40 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id CD38E37B0 for ; Mon, 8 Jul 2019 16:24:39 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x68EJZjI027281; Mon, 8 Jul 2019 07:24:38 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=yWs1CfmA3CXV0h3Smtz6Y53VehyNF16h0dNLlH01TQU=; b=NvyPn8x/JPBfNZDkB1Waovkp7ae90aEffvK4+TcwBmWaXQS3tJxa3RIqGHXFgSuezvOV vuoZ6FHJKTGAQPVKP8R8+jTRo8wg4mPDhXXLy18Ha1c6ZulVwyE3AFfnwQjJFG/ts9cF EEQKGMslJrx2JJ33cqxAvACUL7CC7Klx3c9MrGZTS8oNGOoABU8WKu5NkfqO4YE45giK Kqt+3Lybtg2vICh0jzstGoDnwGQbgXQ39ZXalZlDWCPhkstkJt3s6LWOnXYoacDAqzxp broMvQ8lswfysqqTD5b0Kdf3sOuBiFOv4ssW9IrTSDso68ROuJMQUxTw6EcUsfi6Ddem kQ== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0b-0016f401.pphosted.com with ESMTP id 2tm768r2sc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 08 Jul 2019 07:24:38 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Mon, 8 Jul 2019 07:24:36 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Mon, 8 Jul 2019 07:24:36 -0700 Received: from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14]) by maili.marvell.com (Postfix) with ESMTP id F34F63F703F; Mon, 8 Jul 2019 07:24:34 -0700 (PDT) From: To: CC: , , , , Jerin Jacob Date: Mon, 8 Jul 2019 19:54:50 +0530 Message-ID: <20190708142450.51597-1-jerinj@marvell.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-07-08_05:, , signatures=0 Subject: [dpdk-dev] [PATCH] bus/pci: fix IOVA as VA mode selection 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: Jerin Jacob Existing logic fails to select IOVA mode as VA if driver request to enable IOVA as VA. IOVA as VA has more strict requirement than other modes, so enabling positive logic for IOVA as VA selection. This patch also updates the default IOVA mode as PA for PCI devices as it has to deal with DMA engines unlike the virtual devices that may need only IOVA as DC. Fixes: 703458e19c16 ("bus/pci: consider only usable devices for IOVA mode") Signed-off-by: Jerin Jacob --- If system has only IOVA as VA devices, with out this patch none of the devices works on top of tree now. Request to review and close it for RC1. --- drivers/bus/pci/linux/pci.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/bus/pci/linux/pci.c b/drivers/bus/pci/linux/pci.c index 33c8ea7e9..99636831e 100644 --- a/drivers/bus/pci/linux/pci.c +++ b/drivers/bus/pci/linux/pci.c @@ -567,7 +567,7 @@ enum rte_iova_mode pci_device_iova_mode(const struct rte_pci_driver *pdrv, const struct rte_pci_device *pdev) { - enum rte_iova_mode iova_mode = RTE_IOVA_DC; + enum rte_iova_mode iova_mode = RTE_IOVA_PA; static int iommu_no_va = -1; switch (pdev->kdrv) { @@ -581,8 +581,8 @@ pci_device_iova_mode(const struct rte_pci_driver *pdrv, else is_vfio_noiommu_enabled = 0; } - if ((pdrv->drv_flags & RTE_PCI_DRV_IOVA_AS_VA) == 0) { - iova_mode = RTE_IOVA_PA; + if (pdrv->drv_flags & RTE_PCI_DRV_IOVA_AS_VA) { + iova_mode = RTE_IOVA_VA; } else if (is_vfio_noiommu_enabled != 0) { RTE_LOG(DEBUG, EAL, "Forcing to 'PA', vfio-noiommu mode configured\n"); iova_mode = RTE_IOVA_PA; @@ -592,8 +592,8 @@ pci_device_iova_mode(const struct rte_pci_driver *pdrv, } case RTE_KDRV_NIC_MLX: - if ((pdrv->drv_flags & RTE_PCI_DRV_IOVA_AS_VA) == 0) - iova_mode = RTE_IOVA_PA; + if (pdrv->drv_flags & RTE_PCI_DRV_IOVA_AS_VA) + iova_mode = RTE_IOVA_VA; break; case RTE_KDRV_IGB_UIO: -- 2.22.0