From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.windriver.com (mail.windriver.com [147.11.1.11]) by dpdk.org (Postfix) with ESMTP id 3B0B43777 for ; Tue, 14 Mar 2017 17:33:17 +0100 (CET) Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail.windriver.com (8.15.2/8.15.1) with ESMTPS id v2EGXF9o024603 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL); Tue, 14 Mar 2017 09:33:16 -0700 (PDT) Received: from yow-cgts4-lx.wrs.com (128.224.145.137) by ALA-HCA.corp.ad.wrs.com (147.11.189.50) with Microsoft SMTP Server (TLS) id 14.3.294.0; Tue, 14 Mar 2017 09:33:14 -0700 From: Allain Legacy To: CC: Date: Tue, 14 Mar 2017 12:33:09 -0400 Message-ID: <1489509189-166941-1-git-send-email-allain.legacy@windriver.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [128.224.145.137] Subject: [dpdk-dev] [PATCH] igb_uio: support devices with at least 1 bar defined 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: Tue, 14 Mar 2017 16:33:17 -0000 From: Matt Peters Allow the BAR setup to succeed if a device has at least 1 BAR region defined. Previously, the device probe would only succeed if at least one memory BAR existed, but there are devices that have only port I/O BARs. For example, on Virtual Box a virtio device has only a single I/O BAR because by default MSI-X is not enabled. While in qemu/kvm the virtio device has MSI-X enabled and therefore has both an I/O and Memory BAR. The following are excerpts from "lspci -nnvvvv -s 00:09.0" on both types of systems. Virtual Box: Region 0: I/O ports at d260 [size=32] Capabilities: [80] #00 [0000] QEMU/KVM: Region 0: I/O ports at c060 [size=32] Region 1: Memory at febd1000 (32-bit, non-prefetchable) [size=4K] Expansion ROM at feb80000 [disabled] [size=256K] Capabilities: [40] MSI-X: Enable+ Count=3 Masked- Vector table: BAR=1 offset=00000000 PBA: BAR=1 offset=00000800 Signed-off-by: Matt Peters Signed-off-by: Allain Legacy --- lib/librte_eal/linuxapp/igb_uio/igb_uio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c index df41e45..a910eb8 100644 --- a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c +++ b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c @@ -314,7 +314,7 @@ struct rte_uio_pci_dev { } } - return (iom != 0) ? ret : -ENOENT; + return (iom != 0 || iop != 0) ? ret : -ENOENT; } #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0) -- 1.8.3.1