DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] igb_uio: support devices with at least 1 bar defined
@ 2017-03-14 16:33 Allain Legacy
  2017-03-14 16:59 ` Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Allain Legacy @ 2017-03-14 16:33 UTC (permalink / raw)
  To: ferruh.yigit; +Cc: dev

From: Matt Peters <matt.peters@windriver.com>

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 <matt.peters@windriver.com>
Signed-off-by: Allain Legacy <allain.legacy@windriver.com>
---
 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] igb_uio: support devices with at least 1 bar defined
  2017-03-14 16:33 [dpdk-dev] [PATCH] igb_uio: support devices with at least 1 bar defined Allain Legacy
@ 2017-03-14 16:59 ` Ferruh Yigit
  2017-03-15 13:01   ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Ferruh Yigit @ 2017-03-14 16:59 UTC (permalink / raw)
  To: Allain Legacy; +Cc: dev

On 3/14/2017 4:33 PM, Allain Legacy wrote:
> From: Matt Peters <matt.peters@windriver.com>
> 
> 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 <matt.peters@windriver.com>
> Signed-off-by: Allain Legacy <allain.legacy@windriver.com>

Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] igb_uio: support devices with at least 1 bar defined
  2017-03-14 16:59 ` Ferruh Yigit
@ 2017-03-15 13:01   ` Thomas Monjalon
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2017-03-15 13:01 UTC (permalink / raw)
  To: Allain Legacy; +Cc: dev, Ferruh Yigit

2017-03-14 16:59, Ferruh Yigit:
> On 3/14/2017 4:33 PM, Allain Legacy wrote:
> > From: Matt Peters <matt.peters@windriver.com>
> > 
> > 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 <matt.peters@windriver.com>
> > Signed-off-by: Allain Legacy <allain.legacy@windriver.com>
> 
> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-03-15 13:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-14 16:33 [dpdk-dev] [PATCH] igb_uio: support devices with at least 1 bar defined Allain Legacy
2017-03-14 16:59 ` Ferruh Yigit
2017-03-15 13:01   ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).