From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from netronome.com (host-79-78-33-110.static.as9105.net [79.78.33.110]) by dpdk.org (Postfix) with ESMTP id 20AAF3195 for ; Fri, 5 Oct 2018 14:46:51 +0200 (CEST) Received: from netronome.com (localhost [127.0.0.1]) by netronome.com (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id w95CjUD8008378 for ; Fri, 5 Oct 2018 13:45:30 +0100 Received: (from alucero@localhost) by netronome.com (8.14.4/8.14.4/Submit) id w95CjUbx008377 for dev@dpdk.org; Fri, 5 Oct 2018 13:45:30 +0100 From: Alejandro Lucero To: dev@dpdk.org Date: Fri, 5 Oct 2018 13:45:24 +0100 Message-Id: <1538743527-8285-4-git-send-email-alejandro.lucero@netronome.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1538743527-8285-1-git-send-email-alejandro.lucero@netronome.com> References: <1538743527-8285-1-git-send-email-alejandro.lucero@netronome.com> Subject: [dpdk-dev] [PATCH v3 3/6] bus/pci: check iommu addressing limitation just once 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: Fri, 05 Oct 2018 12:46:51 -0000 Current code checks if IOMMU hardware reports enough addressing bits for using IOVA mode but it repeats the same check for any PCI device present. This is not necessary because the IOMMU hardware is the same for all of them. This patch only checks the IOMMU using first PCI device found. Signed-off-by: Alejandro Lucero Acked-by: Anatoly Burakov --- drivers/bus/pci/linux/pci.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/bus/pci/linux/pci.c b/drivers/bus/pci/linux/pci.c index 04648ac..a871549 100644 --- a/drivers/bus/pci/linux/pci.c +++ b/drivers/bus/pci/linux/pci.c @@ -620,8 +620,11 @@ FOREACH_DEVICE_ON_PCIBUS(dev) { if (!rte_pci_match(drv, dev)) continue; - if (!pci_one_device_iommu_support_va(dev)) - return false; + /* + * just one PCI device needs to be checked out because + * the IOMMU hardware is the same for all of them. + */ + return pci_one_device_iommu_support_va(dev); } } return true; -- 1.9.1