[dpdk-dev] [Question] How pmd virtio works without UIO?

Thomas Monjalon thomas.monjalon at 6wind.com
Wed Dec 23 23:26:17 CET 2015


2015-12-23 10:09, Yuanhan Liu:
> On Wed, Dec 23, 2015 at 09:55:54AM +0800, Peter Xu wrote:
> > On Tue, Dec 22, 2015 at 04:38:30PM +0000, Xie, Huawei wrote:
> > > On 12/22/2015 7:39 PM, Peter Xu wrote:
> > > > I tried to unbind one of the virtio net device, I see the PCI entry
> > > > still there.
> > > >
> > > > Before unbind:
> > > >
> > > > [root at vm proc]# lspci -k -s 00:03.0
> > > > 00:03.0 Ethernet controller: Red Hat, Inc Virtio network device
> > > >         Subsystem: Red Hat, Inc Device 0001
> > > >         Kernel driver in use: virtio-pci
> > > > [root at vm proc]# cat /proc/ioports | grep c060-c07f
> > > >   c060-c07f : 0000:00:03.0
> > > >     c060-c07f : virtio-pci
> > > >
> > > > After unbind:
> > > >
> > > > [root at vm proc]# lspci -k -s 00:03.0
> > > > 00:03.0 Ethernet controller: Red Hat, Inc Virtio network device
> > > >         Subsystem: Red Hat, Inc Device 0001
> > > > [root at vm proc]# cat /proc/ioports | grep c060-c07f
> > > >   c060-c07f : 0000:00:03.0
> > > >
> > > > So... does this means that it is an alternative to black list
> > > > solution?
> > > Oh, we could firstly check if this port is manipulated by kernel driver
> > > in virtio_resource_init/eth_virtio_dev_init, as long as it is not too late.
> 
> Why can't we simply quit at pci_scan_one, once finding that it's not
> bond to uio (or similar stuff)? That would be generic enough, that we
> don't have to do similar checks for each new pmd driver.
> 
> Or, am I missing something?

UIO is not needed to make virtio works (without interrupt support).
Sometimes it may be required to avoid using kernel modules.

> > I guess there might be two problems? Which are:
> > 
> > 1. How user avoid DPDK taking over virtio devices that they do not
> >    want for IO (chooses which device to use)
> 
> Isn't that what's the 'binding/unbinding' for?

Binding is, sometimes, required.
But does it mean DPDK should use every available ports?
That's the default and may be configured with blacklist/whitelist.

> > 2. Driver conflict between virtio PMD in DPDK, and virtio-pci in
> >    kernel (happens on every virtio device that DPDK uses)
> 
> If you unbinded the kernel driver first, which is the suggested (or
> must?) way to use DPDK, that will not happen.



More information about the dev mailing list