DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] Query : Does Binding with vfio-pci is supported inside qemu-kvm guest/vm instance.?
@ 2019-03-12  5:27 Thanneeru Srinivasulu
  2019-03-12  9:38 ` Bruce Richardson
  0 siblings, 1 reply; 17+ messages in thread
From: Thanneeru Srinivasulu @ 2019-03-12  5:27 UTC (permalink / raw)
  To: dev

Hi Everyone.

I did attached pice  to Guest VM using vfio-pci with qemu command, and then
tried binding the pcie bdf with vfio-pci, observing binding failure with
vfio-pci.

Where as when tryied with igb_uio, everything works fine.

Does Binding with vfio-pci is supported inside VM/guest?

Regards
Srinivasulu

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

* Re: [dpdk-dev] Query : Does Binding with vfio-pci is supported inside qemu-kvm guest/vm instance.?
  2019-03-12  5:27 [dpdk-dev] Query : Does Binding with vfio-pci is supported inside qemu-kvm guest/vm instance.? Thanneeru Srinivasulu
@ 2019-03-12  9:38 ` Bruce Richardson
  2019-03-12  9:42   ` Thanneeru Srinivasulu
  0 siblings, 1 reply; 17+ messages in thread
From: Bruce Richardson @ 2019-03-12  9:38 UTC (permalink / raw)
  To: Thanneeru Srinivasulu; +Cc: dev

On Tue, Mar 12, 2019 at 10:57:55AM +0530, Thanneeru Srinivasulu wrote:
> Hi Everyone.
> 
> I did attached pice  to Guest VM using vfio-pci with qemu command, and then
> tried binding the pcie bdf with vfio-pci, observing binding failure with
> vfio-pci.
> 
> Where as when tryied with igb_uio, everything works fine.
> 
> Does Binding with vfio-pci is supported inside VM/guest?
> 
vfio support requires the presence of an IOMMU, and you generally don't
have an IOMMU available in a VM.

/Bruce

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

* Re: [dpdk-dev] Query : Does Binding with vfio-pci is supported inside qemu-kvm guest/vm instance.?
  2019-03-12  9:38 ` Bruce Richardson
@ 2019-03-12  9:42   ` Thanneeru Srinivasulu
  2019-03-12  9:54     ` Jason Wang
  0 siblings, 1 reply; 17+ messages in thread
From: Thanneeru Srinivasulu @ 2019-03-12  9:42 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev

Thanks Bruce..

On Tue, Mar 12, 2019 at 3:08 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> On Tue, Mar 12, 2019 at 10:57:55AM +0530, Thanneeru Srinivasulu wrote:
> > Hi Everyone.
> >
> > I did attached pice  to Guest VM using vfio-pci with qemu command, and then
> > tried binding the pcie bdf with vfio-pci, observing binding failure with
> > vfio-pci.
> >
> > Where as when tryied with igb_uio, everything works fine.
> >
> > Does Binding with vfio-pci is supported inside VM/guest?
> >
> vfio support requires the presence of an IOMMU, and you generally don't
> have an IOMMU available in a VM.
>
> /Bruce



-- 
Regards,
Srinivas

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

* Re: [dpdk-dev] Query : Does Binding with vfio-pci is supported inside qemu-kvm guest/vm instance.?
  2019-03-12  9:42   ` Thanneeru Srinivasulu
@ 2019-03-12  9:54     ` Jason Wang
  2019-03-12 10:20       ` Bruce Richardson
  0 siblings, 1 reply; 17+ messages in thread
From: Jason Wang @ 2019-03-12  9:54 UTC (permalink / raw)
  To: Thanneeru Srinivasulu, Bruce Richardson; +Cc: dev


On 2019/3/12 下午5:42, Thanneeru Srinivasulu wrote:
> Thanks Bruce..
>
> On Tue, Mar 12, 2019 at 3:08 PM Bruce Richardson
> <bruce.richardson@intel.com> wrote:
>> On Tue, Mar 12, 2019 at 10:57:55AM +0530, Thanneeru Srinivasulu wrote:
>>> Hi Everyone.
>>>
>>> I did attached pice  to Guest VM using vfio-pci with qemu command, and then
>>> tried binding the pcie bdf with vfio-pci, observing binding failure with
>>> vfio-pci.
>>>
>>> Where as when tryied with igb_uio, everything works fine.
>>>
>>> Does Binding with vfio-pci is supported inside VM/guest?
>>>
>> vfio support requires the presence of an IOMMU, and you generally don't
>> have an IOMMU available in a VM.
>>
>> /Bruce


Actually, Qemu support vIOMMU + VFIO in guest[1], all you need is to add 
a intel IOMMU and enabling caching mode.

Thanks


[1]

https://www.lfasiallc.com/wp-content/uploads/2017/11/Device-Assignment-with-Nested-Guests-and-DPDK_Peter-Xu.pdf

>
>

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

* Re: [dpdk-dev] Query : Does Binding with vfio-pci is supported inside qemu-kvm guest/vm instance.?
  2019-03-12  9:54     ` Jason Wang
@ 2019-03-12 10:20       ` Bruce Richardson
  2019-03-12 10:57         ` Burakov, Anatoly
  0 siblings, 1 reply; 17+ messages in thread
From: Bruce Richardson @ 2019-03-12 10:20 UTC (permalink / raw)
  To: Jason Wang; +Cc: Thanneeru Srinivasulu, dev

On Tue, Mar 12, 2019 at 05:54:39PM +0800, Jason Wang wrote:
> 
> On 2019/3/12 下午5:42, Thanneeru Srinivasulu wrote:
> > Thanks Bruce..
> > 
> > On Tue, Mar 12, 2019 at 3:08 PM Bruce Richardson
> > <bruce.richardson@intel.com> wrote:
> > > On Tue, Mar 12, 2019 at 10:57:55AM +0530, Thanneeru Srinivasulu wrote:
> > > > Hi Everyone.
> > > > 
> > > > I did attached pice  to Guest VM using vfio-pci with qemu command, and then
> > > > tried binding the pcie bdf with vfio-pci, observing binding failure with
> > > > vfio-pci.
> > > > 
> > > > Where as when tryied with igb_uio, everything works fine.
> > > > 
> > > > Does Binding with vfio-pci is supported inside VM/guest?
> > > > 
> > > vfio support requires the presence of an IOMMU, and you generally don't
> > > have an IOMMU available in a VM.
> > > 
> > > /Bruce
> 
> 
> Actually, Qemu support vIOMMU + VFIO in guest[1], all you need is to add a
> intel IOMMU and enabling caching mode.
> 
> Thanks
> 
> 
> [1]
> 
> https://www.lfasiallc.com/wp-content/uploads/2017/11/Device-Assignment-with-Nested-Guests-and-DPDK_Peter-Xu.pdf
> 
Thanks for the info.

/Bruce

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

* Re: [dpdk-dev] Query : Does Binding with vfio-pci is supported inside qemu-kvm guest/vm instance.?
  2019-03-12 10:20       ` Bruce Richardson
@ 2019-03-12 10:57         ` Burakov, Anatoly
       [not found]           ` <CGME20190312110957eucas1p1af74c8d26bf80fd815847ed8086a1e78@eucas1p1.samsung.com>
  2019-04-02 10:38           ` John Sucaet
  0 siblings, 2 replies; 17+ messages in thread
From: Burakov, Anatoly @ 2019-03-12 10:57 UTC (permalink / raw)
  To: Bruce Richardson, Jason Wang; +Cc: Thanneeru Srinivasulu, dev

On 12-Mar-19 10:20 AM, Bruce Richardson wrote:
> On Tue, Mar 12, 2019 at 05:54:39PM +0800, Jason Wang wrote:
>>
>> On 2019/3/12 下午5:42, Thanneeru Srinivasulu wrote:
>>> Thanks Bruce..
>>>
>>> On Tue, Mar 12, 2019 at 3:08 PM Bruce Richardson
>>> <bruce.richardson@intel.com> wrote:
>>>> On Tue, Mar 12, 2019 at 10:57:55AM +0530, Thanneeru Srinivasulu wrote:
>>>>> Hi Everyone.
>>>>>
>>>>> I did attached pice  to Guest VM using vfio-pci with qemu command, and then
>>>>> tried binding the pcie bdf with vfio-pci, observing binding failure with
>>>>> vfio-pci.
>>>>>
>>>>> Where as when tryied with igb_uio, everything works fine.
>>>>>
>>>>> Does Binding with vfio-pci is supported inside VM/guest?
>>>>>
>>>> vfio support requires the presence of an IOMMU, and you generally don't
>>>> have an IOMMU available in a VM.
>>>>
>>>> /Bruce
>>
>>
>> Actually, Qemu support vIOMMU + VFIO in guest[1], all you need is to add a
>> intel IOMMU and enabling caching mode.
>>
>> Thanks
>>
>>
>> [1]
>>
>> https://www.lfasiallc.com/wp-content/uploads/2017/11/Device-Assignment-with-Nested-Guests-and-DPDK_Peter-Xu.pdf
>>
> Thanks for the info.
> 
> /Bruce
> 

One more thing: even without vIOMMU, VFIO has no-IOMMU mode which can be 
enabled (for a recent-enough kernel). This will make VFIO work even in 
cases where the guest doesn't have IOMMU emulation. See? There's no 
reason to use igb_uio, ever! :D

-- 
Thanks,
Anatoly

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

* Re: [dpdk-dev] Query : Does Binding with vfio-pci is supported inside qemu-kvm guest/vm instance.?
       [not found]           ` <CGME20190312110957eucas1p1af74c8d26bf80fd815847ed8086a1e78@eucas1p1.samsung.com>
@ 2019-03-12 11:09             ` Ilya Maximets
  0 siblings, 0 replies; 17+ messages in thread
From: Ilya Maximets @ 2019-03-12 11:09 UTC (permalink / raw)
  To: dev, Thanneeru Srinivasulu
  Cc: Jason Wang, Konstantin Ananyev, Anatoly Burakov

> On 12-Mar-19 10:20 AM, Bruce Richardson wrote:
>> On Tue, Mar 12, 2019 at 05:54:39PM +0800, Jason Wang wrote:
>>>
>>> On 2019/3/12 下午5:42, Thanneeru Srinivasulu wrote:
>>>> Thanks Bruce..
>>>>
>>>> On Tue, Mar 12, 2019 at 3:08 PM Bruce Richardson
>>>> <bruce.richardson at intel.com> wrote:
>>>>> On Tue, Mar 12, 2019 at 10:57:55AM +0530, Thanneeru Srinivasulu wrote:
>>>>>> Hi Everyone.
>>>>>>
>>>>>> I did attached pice  to Guest VM using vfio-pci with qemu command, and then
>>>>>> tried binding the pcie bdf with vfio-pci, observing binding failure with
>>>>>> vfio-pci.
>>>>>>
>>>>>> Where as when tryied with igb_uio, everything works fine.
>>>>>>
>>>>>> Does Binding with vfio-pci is supported inside VM/guest?
>>>>>>
>>>>> vfio support requires the presence of an IOMMU, and you generally don't
>>>>> have an IOMMU available in a VM.
>>>>>
>>>>> /Bruce
>>>
>>>
>>> Actually, Qemu support vIOMMU + VFIO in guest[1], all you need is to add a
>>> intel IOMMU and enabling caching mode.
>>>
>>> Thanks
>>>
>>>
>>> [1]
>>>
>>> https://www.lfasiallc.com/wp-content/uploads/2017/11/Device-Assignment-with-Nested-Guests-and-DPDK_Peter-Xu.pdf
>>>
>> Thanks for the info.
>> 
>> /Bruce
>> 
> 
> One more thing: even without vIOMMU, VFIO has no-IOMMU mode which can be 
> enabled (for a recent-enough kernel). This will make VFIO work even in 
> cases where the guest doesn't have IOMMU emulation. See? There's no 
> reason to use igb_uio, ever! :D

Agree.

You could use following commands to enable no-IOMMU mode:

  modprobe vfio-pci
  echo 1 > /sys/module/vfio/parameters/enable_unsafe_noiommu_mode

This should allow using vfio-pci driver without IOMMU emulation.
However, there will be no any security accordingly.

Best regards, Ilya Maximets.

> 
> -- 
> Thanks,
> Anatoly
> 

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

* Re: [dpdk-dev] Query : Does Binding with vfio-pci is supported inside qemu-kvm guest/vm instance.?
  2019-03-12 10:57         ` Burakov, Anatoly
       [not found]           ` <CGME20190312110957eucas1p1af74c8d26bf80fd815847ed8086a1e78@eucas1p1.samsung.com>
@ 2019-04-02 10:38           ` John Sucaet
  2019-04-02 10:38             ` John Sucaet
  2019-04-02 13:38             ` Burakov, Anatoly
  1 sibling, 2 replies; 17+ messages in thread
From: John Sucaet @ 2019-04-02 10:38 UTC (permalink / raw)
  To: dev, anatoly.burakov

Hi Anatoly,

As you said: There's no reason to use igb_uio, ever!
I would like to ask whether vfio-pci with or without vIOMMU should/could 
work for virtio-pci net devices in the case of a 32-bit dpdk 
application, on a 64-bit kernel (4.9) inside a guest VM 
(qemu-2.10.2-1.fc27)?

I tried both a 64-bit and a 32-bit version of the same application, but 
only in the case of the 64-bit application, the port was found by eal. 
The 32-bit application gave errors like:

EAL: pci_map_resource(): cannot mmap(16, 0xf4a01000, 0x4000, 0x0): 
Invalid argument (0xffffffff)
EAL: Failed to map pci BAR4
EAL:   0000:00:02.0 mapping BAR4 failed: Invalid argument
EAL: Can't write to PCI bar (0) : offset (12)
EAL: Can't read from PCI bar (0) : offset (12)
EAL: Can't read from PCI bar (0) : offset (12)
EAL: Can't write to PCI bar (0) : offset (12)
EAL: Can't read from PCI bar (0) : offset (12)
EAL: Can't write to PCI bar (0) : offset (12)
EAL: Can't read from PCI bar (0) : offset (0)
EAL: Can't write to PCI bar (0) : offset (4)
EAL: Can't write to PCI bar (0) : offset (14)
EAL: Can't read from PCI bar (0) : offset (14)
EAL: Can't read from PCI bar (0) : offset (1a)
EAL: Can't read from PCI bar (0) : offset (1c)
EAL: Can't write to PCI bar (0) : offset (e)
EAL: Can't read from PCI bar (0) : offset (c)
virtio_init_queue(): virtqueue size is not powerof 2
EAL: Requested device 0000:00:02.0 cannot be used

Maybe you have an idea what went wrong here?

By preference, I would like to continue to use the 32-bit application 
which worked fine with the igb_uio driver.


Thanks

John


On 03/12/2019 11:57 AM, Burakov, Anatoly wrote:
> On 12-Mar-19 10:20 AM, Bruce Richardson wrote:
>> On Tue, Mar 12, 2019 at 05:54:39PM +0800, Jason Wang wrote:
>>>
>>> On 2019/3/12 下午5:42, Thanneeru Srinivasulu wrote:
>>>> Thanks Bruce..
>>>>
>>>> On Tue, Mar 12, 2019 at 3:08 PM Bruce Richardson
>>>> <bruce.richardson@intel.com> wrote:
>>>>> On Tue, Mar 12, 2019 at 10:57:55AM +0530, Thanneeru Srinivasulu 
>>>>> wrote:
>>>>>> Hi Everyone.
>>>>>>
>>>>>> I did attached pice  to Guest VM using vfio-pci with qemu 
>>>>>> command, and then
>>>>>> tried binding the pcie bdf with vfio-pci, observing binding 
>>>>>> failure with
>>>>>> vfio-pci.
>>>>>>
>>>>>> Where as when tryied with igb_uio, everything works fine.
>>>>>>
>>>>>> Does Binding with vfio-pci is supported inside VM/guest?
>>>>>>
>>>>> vfio support requires the presence of an IOMMU, and you generally 
>>>>> don't
>>>>> have an IOMMU available in a VM.
>>>>>
>>>>> /Bruce
>>>
>>>
>>> Actually, Qemu support vIOMMU + VFIO in guest[1], all you need is to 
>>> add a
>>> intel IOMMU and enabling caching mode.
>>>
>>> Thanks
>>>
>>>
>>> [1]
>>>
>>> https://www.lfasiallc.com/wp-content/uploads/2017/11/Device-Assignment-with-Nested-Guests-and-DPDK_Peter-Xu.pdf 
>>>
>>>
>> Thanks for the info.
>>
>> /Bruce
>>
>
> One more thing: even without vIOMMU, VFIO has no-IOMMU mode which can 
> be enabled (for a recent-enough kernel). This will make VFIO work even 
> in cases where the guest doesn't have IOMMU emulation. See? There's no 
> reason to use igb_uio, ever! :D
>

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

* Re: [dpdk-dev] Query : Does Binding with vfio-pci is supported inside qemu-kvm guest/vm instance.?
  2019-04-02 10:38           ` John Sucaet
@ 2019-04-02 10:38             ` John Sucaet
  2019-04-02 13:38             ` Burakov, Anatoly
  1 sibling, 0 replies; 17+ messages in thread
From: John Sucaet @ 2019-04-02 10:38 UTC (permalink / raw)
  To: dev, anatoly.burakov

Hi Anatoly,

As you said: There's no reason to use igb_uio, ever!
I would like to ask whether vfio-pci with or without vIOMMU should/could 
work for virtio-pci net devices in the case of a 32-bit dpdk 
application, on a 64-bit kernel (4.9) inside a guest VM 
(qemu-2.10.2-1.fc27)?

I tried both a 64-bit and a 32-bit version of the same application, but 
only in the case of the 64-bit application, the port was found by eal. 
The 32-bit application gave errors like:

EAL: pci_map_resource(): cannot mmap(16, 0xf4a01000, 0x4000, 0x0): 
Invalid argument (0xffffffff)
EAL: Failed to map pci BAR4
EAL:   0000:00:02.0 mapping BAR4 failed: Invalid argument
EAL: Can't write to PCI bar (0) : offset (12)
EAL: Can't read from PCI bar (0) : offset (12)
EAL: Can't read from PCI bar (0) : offset (12)
EAL: Can't write to PCI bar (0) : offset (12)
EAL: Can't read from PCI bar (0) : offset (12)
EAL: Can't write to PCI bar (0) : offset (12)
EAL: Can't read from PCI bar (0) : offset (0)
EAL: Can't write to PCI bar (0) : offset (4)
EAL: Can't write to PCI bar (0) : offset (14)
EAL: Can't read from PCI bar (0) : offset (14)
EAL: Can't read from PCI bar (0) : offset (1a)
EAL: Can't read from PCI bar (0) : offset (1c)
EAL: Can't write to PCI bar (0) : offset (e)
EAL: Can't read from PCI bar (0) : offset (c)
virtio_init_queue(): virtqueue size is not powerof 2
EAL: Requested device 0000:00:02.0 cannot be used

Maybe you have an idea what went wrong here?

By preference, I would like to continue to use the 32-bit application 
which worked fine with the igb_uio driver.


Thanks

John


On 03/12/2019 11:57 AM, Burakov, Anatoly wrote:
> On 12-Mar-19 10:20 AM, Bruce Richardson wrote:
>> On Tue, Mar 12, 2019 at 05:54:39PM +0800, Jason Wang wrote:
>>>
>>> On 2019/3/12 下午5:42, Thanneeru Srinivasulu wrote:
>>>> Thanks Bruce..
>>>>
>>>> On Tue, Mar 12, 2019 at 3:08 PM Bruce Richardson
>>>> <bruce.richardson@intel.com> wrote:
>>>>> On Tue, Mar 12, 2019 at 10:57:55AM +0530, Thanneeru Srinivasulu 
>>>>> wrote:
>>>>>> Hi Everyone.
>>>>>>
>>>>>> I did attached pice  to Guest VM using vfio-pci with qemu 
>>>>>> command, and then
>>>>>> tried binding the pcie bdf with vfio-pci, observing binding 
>>>>>> failure with
>>>>>> vfio-pci.
>>>>>>
>>>>>> Where as when tryied with igb_uio, everything works fine.
>>>>>>
>>>>>> Does Binding with vfio-pci is supported inside VM/guest?
>>>>>>
>>>>> vfio support requires the presence of an IOMMU, and you generally 
>>>>> don't
>>>>> have an IOMMU available in a VM.
>>>>>
>>>>> /Bruce
>>>
>>>
>>> Actually, Qemu support vIOMMU + VFIO in guest[1], all you need is to 
>>> add a
>>> intel IOMMU and enabling caching mode.
>>>
>>> Thanks
>>>
>>>
>>> [1]
>>>
>>> https://www.lfasiallc.com/wp-content/uploads/2017/11/Device-Assignment-with-Nested-Guests-and-DPDK_Peter-Xu.pdf 
>>>
>>>
>> Thanks for the info.
>>
>> /Bruce
>>
>
> One more thing: even without vIOMMU, VFIO has no-IOMMU mode which can 
> be enabled (for a recent-enough kernel). This will make VFIO work even 
> in cases where the guest doesn't have IOMMU emulation. See? There's no 
> reason to use igb_uio, ever! :D
>


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

* Re: [dpdk-dev] Query : Does Binding with vfio-pci is supported inside qemu-kvm guest/vm instance.?
  2019-04-02 10:38           ` John Sucaet
  2019-04-02 10:38             ` John Sucaet
@ 2019-04-02 13:38             ` Burakov, Anatoly
  2019-04-02 13:38               ` Burakov, Anatoly
  2019-04-03  7:49               ` John Sucaet
  1 sibling, 2 replies; 17+ messages in thread
From: Burakov, Anatoly @ 2019-04-02 13:38 UTC (permalink / raw)
  To: John Sucaet, dev, Maxime Coquelin

On 02-Apr-19 11:38 AM, John Sucaet wrote:
> Hi Anatoly,
> 
> As you said: There's no reason to use igb_uio, ever!

That was partly tongue in cheek, but point taken :)

> I would like to ask whether vfio-pci with or without vIOMMU should/could 
> work for virtio-pci net devices in the case of a 32-bit dpdk 
> application, on a 64-bit kernel (4.9) inside a guest VM 
> (qemu-2.10.2-1.fc27)?
> 
> I tried both a 64-bit and a 32-bit version of the same application, but 
> only in the case of the 64-bit application, the port was found by eal. 
> The 32-bit application gave errors like:
> 
> EAL: pci_map_resource(): cannot mmap(16, 0xf4a01000, 0x4000, 0x0): 
> Invalid argument (0xffffffff)
> EAL: Failed to map pci BAR4
> EAL:   0000:00:02.0 mapping BAR4 failed: Invalid argument
> EAL: Can't write to PCI bar (0) : offset (12)
> EAL: Can't read from PCI bar (0) : offset (12)
> EAL: Can't read from PCI bar (0) : offset (12)
> EAL: Can't write to PCI bar (0) : offset (12)
> EAL: Can't read from PCI bar (0) : offset (12)
> EAL: Can't write to PCI bar (0) : offset (12)
> EAL: Can't read from PCI bar (0) : offset (0)
> EAL: Can't write to PCI bar (0) : offset (4)
> EAL: Can't write to PCI bar (0) : offset (14)
> EAL: Can't read from PCI bar (0) : offset (14)
> EAL: Can't read from PCI bar (0) : offset (1a)
> EAL: Can't read from PCI bar (0) : offset (1c)
> EAL: Can't write to PCI bar (0) : offset (e)
> EAL: Can't read from PCI bar (0) : offset (c)
> virtio_init_queue(): virtqueue size is not powerof 2
> EAL: Requested device 0000:00:02.0 cannot be used
> 
> Maybe you have an idea what went wrong here?
> 
> By preference, I would like to continue to use the 32-bit application 
> which worked fine with the igb_uio driver.

Unfortunately, i am not very familiar with virtio and wouldn't know 
whether it's supposed to work under these conditions. Perhaps Maxime 
would be of more help here (CC'd).

> 
> 
> Thanks
> 
> John
> 
> 
> On 03/12/2019 11:57 AM, Burakov, Anatoly wrote:
>> On 12-Mar-19 10:20 AM, Bruce Richardson wrote:
>>> On Tue, Mar 12, 2019 at 05:54:39PM +0800, Jason Wang wrote:
>>>>
>>>> On 2019/3/12 下午5:42, Thanneeru Srinivasulu wrote:
>>>>> Thanks Bruce..
>>>>>
>>>>> On Tue, Mar 12, 2019 at 3:08 PM Bruce Richardson
>>>>> <bruce.richardson@intel.com> wrote:
>>>>>> On Tue, Mar 12, 2019 at 10:57:55AM +0530, Thanneeru Srinivasulu 
>>>>>> wrote:
>>>>>>> Hi Everyone.
>>>>>>>
>>>>>>> I did attached pice  to Guest VM using vfio-pci with qemu 
>>>>>>> command, and then
>>>>>>> tried binding the pcie bdf with vfio-pci, observing binding 
>>>>>>> failure with
>>>>>>> vfio-pci.
>>>>>>>
>>>>>>> Where as when tryied with igb_uio, everything works fine.
>>>>>>>
>>>>>>> Does Binding with vfio-pci is supported inside VM/guest?
>>>>>>>
>>>>>> vfio support requires the presence of an IOMMU, and you generally 
>>>>>> don't
>>>>>> have an IOMMU available in a VM.
>>>>>>
>>>>>> /Bruce
>>>>
>>>>
>>>> Actually, Qemu support vIOMMU + VFIO in guest[1], all you need is to 
>>>> add a
>>>> intel IOMMU and enabling caching mode.
>>>>
>>>> Thanks
>>>>
>>>>
>>>> [1]
>>>>
>>>> https://www.lfasiallc.com/wp-content/uploads/2017/11/Device-Assignment-with-Nested-Guests-and-DPDK_Peter-Xu.pdf 
>>>>
>>>>
>>> Thanks for the info.
>>>
>>> /Bruce
>>>
>>
>> One more thing: even without vIOMMU, VFIO has no-IOMMU mode which can 
>> be enabled (for a recent-enough kernel). This will make VFIO work even 
>> in cases where the guest doesn't have IOMMU emulation. See? There's no 
>> reason to use igb_uio, ever! :D
>>
> 
> 


-- 
Thanks,
Anatoly

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

* Re: [dpdk-dev] Query : Does Binding with vfio-pci is supported inside qemu-kvm guest/vm instance.?
  2019-04-02 13:38             ` Burakov, Anatoly
@ 2019-04-02 13:38               ` Burakov, Anatoly
  2019-04-03  7:49               ` John Sucaet
  1 sibling, 0 replies; 17+ messages in thread
From: Burakov, Anatoly @ 2019-04-02 13:38 UTC (permalink / raw)
  To: John Sucaet, dev, Maxime Coquelin

On 02-Apr-19 11:38 AM, John Sucaet wrote:
> Hi Anatoly,
> 
> As you said: There's no reason to use igb_uio, ever!

That was partly tongue in cheek, but point taken :)

> I would like to ask whether vfio-pci with or without vIOMMU should/could 
> work for virtio-pci net devices in the case of a 32-bit dpdk 
> application, on a 64-bit kernel (4.9) inside a guest VM 
> (qemu-2.10.2-1.fc27)?
> 
> I tried both a 64-bit and a 32-bit version of the same application, but 
> only in the case of the 64-bit application, the port was found by eal. 
> The 32-bit application gave errors like:
> 
> EAL: pci_map_resource(): cannot mmap(16, 0xf4a01000, 0x4000, 0x0): 
> Invalid argument (0xffffffff)
> EAL: Failed to map pci BAR4
> EAL:   0000:00:02.0 mapping BAR4 failed: Invalid argument
> EAL: Can't write to PCI bar (0) : offset (12)
> EAL: Can't read from PCI bar (0) : offset (12)
> EAL: Can't read from PCI bar (0) : offset (12)
> EAL: Can't write to PCI bar (0) : offset (12)
> EAL: Can't read from PCI bar (0) : offset (12)
> EAL: Can't write to PCI bar (0) : offset (12)
> EAL: Can't read from PCI bar (0) : offset (0)
> EAL: Can't write to PCI bar (0) : offset (4)
> EAL: Can't write to PCI bar (0) : offset (14)
> EAL: Can't read from PCI bar (0) : offset (14)
> EAL: Can't read from PCI bar (0) : offset (1a)
> EAL: Can't read from PCI bar (0) : offset (1c)
> EAL: Can't write to PCI bar (0) : offset (e)
> EAL: Can't read from PCI bar (0) : offset (c)
> virtio_init_queue(): virtqueue size is not powerof 2
> EAL: Requested device 0000:00:02.0 cannot be used
> 
> Maybe you have an idea what went wrong here?
> 
> By preference, I would like to continue to use the 32-bit application 
> which worked fine with the igb_uio driver.

Unfortunately, i am not very familiar with virtio and wouldn't know 
whether it's supposed to work under these conditions. Perhaps Maxime 
would be of more help here (CC'd).

> 
> 
> Thanks
> 
> John
> 
> 
> On 03/12/2019 11:57 AM, Burakov, Anatoly wrote:
>> On 12-Mar-19 10:20 AM, Bruce Richardson wrote:
>>> On Tue, Mar 12, 2019 at 05:54:39PM +0800, Jason Wang wrote:
>>>>
>>>> On 2019/3/12 下午5:42, Thanneeru Srinivasulu wrote:
>>>>> Thanks Bruce..
>>>>>
>>>>> On Tue, Mar 12, 2019 at 3:08 PM Bruce Richardson
>>>>> <bruce.richardson@intel.com> wrote:
>>>>>> On Tue, Mar 12, 2019 at 10:57:55AM +0530, Thanneeru Srinivasulu 
>>>>>> wrote:
>>>>>>> Hi Everyone.
>>>>>>>
>>>>>>> I did attached pice  to Guest VM using vfio-pci with qemu 
>>>>>>> command, and then
>>>>>>> tried binding the pcie bdf with vfio-pci, observing binding 
>>>>>>> failure with
>>>>>>> vfio-pci.
>>>>>>>
>>>>>>> Where as when tryied with igb_uio, everything works fine.
>>>>>>>
>>>>>>> Does Binding with vfio-pci is supported inside VM/guest?
>>>>>>>
>>>>>> vfio support requires the presence of an IOMMU, and you generally 
>>>>>> don't
>>>>>> have an IOMMU available in a VM.
>>>>>>
>>>>>> /Bruce
>>>>
>>>>
>>>> Actually, Qemu support vIOMMU + VFIO in guest[1], all you need is to 
>>>> add a
>>>> intel IOMMU and enabling caching mode.
>>>>
>>>> Thanks
>>>>
>>>>
>>>> [1]
>>>>
>>>> https://www.lfasiallc.com/wp-content/uploads/2017/11/Device-Assignment-with-Nested-Guests-and-DPDK_Peter-Xu.pdf 
>>>>
>>>>
>>> Thanks for the info.
>>>
>>> /Bruce
>>>
>>
>> One more thing: even without vIOMMU, VFIO has no-IOMMU mode which can 
>> be enabled (for a recent-enough kernel). This will make VFIO work even 
>> in cases where the guest doesn't have IOMMU emulation. See? There's no 
>> reason to use igb_uio, ever! :D
>>
> 
> 


-- 
Thanks,
Anatoly

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

* Re: [dpdk-dev] Query : Does Binding with vfio-pci is supported inside qemu-kvm guest/vm instance.?
  2019-04-02 13:38             ` Burakov, Anatoly
  2019-04-02 13:38               ` Burakov, Anatoly
@ 2019-04-03  7:49               ` John Sucaet
  2019-04-03  7:49                 ` John Sucaet
  2019-04-03  7:54                 ` Maxime Coquelin
  1 sibling, 2 replies; 17+ messages in thread
From: John Sucaet @ 2019-04-03  7:49 UTC (permalink / raw)
  To: Burakov, Anatoly, dev, Maxime Coquelin

Thanks, Anatoly.

Maxime, could you enlighten me a bit? I basically would like to know 
whether I should be able to make my 32-bit dpdk application work with 
virtio-pci-net and vfio-pci (with a 64-bit kernel), or if I should do 
the effort to port to 64-bit (which I would like to avoid for now).

Thank you
John

On 04/02/2019 03:38 PM, Burakov, Anatoly wrote:
> On 02-Apr-19 11:38 AM, John Sucaet wrote:
>> Hi Anatoly,
>>
>> As you said: There's no reason to use igb_uio, ever!
>
> That was partly tongue in cheek, but point taken :)
>
>> I would like to ask whether vfio-pci with or without vIOMMU 
>> should/could work for virtio-pci net devices in the case of a 32-bit 
>> dpdk application, on a 64-bit kernel (4.9) inside a guest VM 
>> (qemu-2.10.2-1.fc27)?
>>
>> I tried both a 64-bit and a 32-bit version of the same application, 
>> but only in the case of the 64-bit application, the port was found by 
>> eal. The 32-bit application gave errors like:
>>
>> EAL: pci_map_resource(): cannot mmap(16, 0xf4a01000, 0x4000, 0x0): 
>> Invalid argument (0xffffffff)
>> EAL: Failed to map pci BAR4
>> EAL:   0000:00:02.0 mapping BAR4 failed: Invalid argument
>> EAL: Can't write to PCI bar (0) : offset (12)
>> EAL: Can't read from PCI bar (0) : offset (12)
>> EAL: Can't read from PCI bar (0) : offset (12)
>> EAL: Can't write to PCI bar (0) : offset (12)
>> EAL: Can't read from PCI bar (0) : offset (12)
>> EAL: Can't write to PCI bar (0) : offset (12)
>> EAL: Can't read from PCI bar (0) : offset (0)
>> EAL: Can't write to PCI bar (0) : offset (4)
>> EAL: Can't write to PCI bar (0) : offset (14)
>> EAL: Can't read from PCI bar (0) : offset (14)
>> EAL: Can't read from PCI bar (0) : offset (1a)
>> EAL: Can't read from PCI bar (0) : offset (1c)
>> EAL: Can't write to PCI bar (0) : offset (e)
>> EAL: Can't read from PCI bar (0) : offset (c)
>> virtio_init_queue(): virtqueue size is not powerof 2
>> EAL: Requested device 0000:00:02.0 cannot be used
>>
>> Maybe you have an idea what went wrong here?
>>
>> By preference, I would like to continue to use the 32-bit application 
>> which worked fine with the igb_uio driver.
>
> Unfortunately, i am not very familiar with virtio and wouldn't know 
> whether it's supposed to work under these conditions. Perhaps Maxime 
> would be of more help here (CC'd).
>
>>
>>
>> Thanks
>>
>> John
>>
>>
>> On 03/12/2019 11:57 AM, Burakov, Anatoly wrote:
>>> On 12-Mar-19 10:20 AM, Bruce Richardson wrote:
>>>> On Tue, Mar 12, 2019 at 05:54:39PM +0800, Jason Wang wrote:
>>>>>
>>>>> On 2019/3/12 下午5:42, Thanneeru Srinivasulu wrote:
>>>>>> Thanks Bruce..
>>>>>>
>>>>>> On Tue, Mar 12, 2019 at 3:08 PM Bruce Richardson
>>>>>> <bruce.richardson@intel.com> wrote:
>>>>>>> On Tue, Mar 12, 2019 at 10:57:55AM +0530, Thanneeru Srinivasulu 
>>>>>>> wrote:
>>>>>>>> Hi Everyone.
>>>>>>>>
>>>>>>>> I did attached pice  to Guest VM using vfio-pci with qemu 
>>>>>>>> command, and then
>>>>>>>> tried binding the pcie bdf with vfio-pci, observing binding 
>>>>>>>> failure with
>>>>>>>> vfio-pci.
>>>>>>>>
>>>>>>>> Where as when tryied with igb_uio, everything works fine.
>>>>>>>>
>>>>>>>> Does Binding with vfio-pci is supported inside VM/guest?
>>>>>>>>
>>>>>>> vfio support requires the presence of an IOMMU, and you 
>>>>>>> generally don't
>>>>>>> have an IOMMU available in a VM.
>>>>>>>
>>>>>>> /Bruce
>>>>>
>>>>>
>>>>> Actually, Qemu support vIOMMU + VFIO in guest[1], all you need is 
>>>>> to add a
>>>>> intel IOMMU and enabling caching mode.
>>>>>
>>>>> Thanks
>>>>>
>>>>>
>>>>> [1]
>>>>>
>>>>> https://www.lfasiallc.com/wp-content/uploads/2017/11/Device-Assignment-with-Nested-Guests-and-DPDK_Peter-Xu.pdf 
>>>>>
>>>>>
>>>> Thanks for the info.
>>>>
>>>> /Bruce
>>>>
>>>
>>> One more thing: even without vIOMMU, VFIO has no-IOMMU mode which 
>>> can be enabled (for a recent-enough kernel). This will make VFIO 
>>> work even in cases where the guest doesn't have IOMMU emulation. 
>>> See? There's no reason to use igb_uio, ever! :D
>>>
>>
>>
>
>

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

* Re: [dpdk-dev] Query : Does Binding with vfio-pci is supported inside qemu-kvm guest/vm instance.?
  2019-04-03  7:49               ` John Sucaet
@ 2019-04-03  7:49                 ` John Sucaet
  2019-04-03  7:54                 ` Maxime Coquelin
  1 sibling, 0 replies; 17+ messages in thread
From: John Sucaet @ 2019-04-03  7:49 UTC (permalink / raw)
  To: Burakov, Anatoly, dev, Maxime Coquelin

Thanks, Anatoly.

Maxime, could you enlighten me a bit? I basically would like to know 
whether I should be able to make my 32-bit dpdk application work with 
virtio-pci-net and vfio-pci (with a 64-bit kernel), or if I should do 
the effort to port to 64-bit (which I would like to avoid for now).

Thank you
John

On 04/02/2019 03:38 PM, Burakov, Anatoly wrote:
> On 02-Apr-19 11:38 AM, John Sucaet wrote:
>> Hi Anatoly,
>>
>> As you said: There's no reason to use igb_uio, ever!
>
> That was partly tongue in cheek, but point taken :)
>
>> I would like to ask whether vfio-pci with or without vIOMMU 
>> should/could work for virtio-pci net devices in the case of a 32-bit 
>> dpdk application, on a 64-bit kernel (4.9) inside a guest VM 
>> (qemu-2.10.2-1.fc27)?
>>
>> I tried both a 64-bit and a 32-bit version of the same application, 
>> but only in the case of the 64-bit application, the port was found by 
>> eal. The 32-bit application gave errors like:
>>
>> EAL: pci_map_resource(): cannot mmap(16, 0xf4a01000, 0x4000, 0x0): 
>> Invalid argument (0xffffffff)
>> EAL: Failed to map pci BAR4
>> EAL:   0000:00:02.0 mapping BAR4 failed: Invalid argument
>> EAL: Can't write to PCI bar (0) : offset (12)
>> EAL: Can't read from PCI bar (0) : offset (12)
>> EAL: Can't read from PCI bar (0) : offset (12)
>> EAL: Can't write to PCI bar (0) : offset (12)
>> EAL: Can't read from PCI bar (0) : offset (12)
>> EAL: Can't write to PCI bar (0) : offset (12)
>> EAL: Can't read from PCI bar (0) : offset (0)
>> EAL: Can't write to PCI bar (0) : offset (4)
>> EAL: Can't write to PCI bar (0) : offset (14)
>> EAL: Can't read from PCI bar (0) : offset (14)
>> EAL: Can't read from PCI bar (0) : offset (1a)
>> EAL: Can't read from PCI bar (0) : offset (1c)
>> EAL: Can't write to PCI bar (0) : offset (e)
>> EAL: Can't read from PCI bar (0) : offset (c)
>> virtio_init_queue(): virtqueue size is not powerof 2
>> EAL: Requested device 0000:00:02.0 cannot be used
>>
>> Maybe you have an idea what went wrong here?
>>
>> By preference, I would like to continue to use the 32-bit application 
>> which worked fine with the igb_uio driver.
>
> Unfortunately, i am not very familiar with virtio and wouldn't know 
> whether it's supposed to work under these conditions. Perhaps Maxime 
> would be of more help here (CC'd).
>
>>
>>
>> Thanks
>>
>> John
>>
>>
>> On 03/12/2019 11:57 AM, Burakov, Anatoly wrote:
>>> On 12-Mar-19 10:20 AM, Bruce Richardson wrote:
>>>> On Tue, Mar 12, 2019 at 05:54:39PM +0800, Jason Wang wrote:
>>>>>
>>>>> On 2019/3/12 下午5:42, Thanneeru Srinivasulu wrote:
>>>>>> Thanks Bruce..
>>>>>>
>>>>>> On Tue, Mar 12, 2019 at 3:08 PM Bruce Richardson
>>>>>> <bruce.richardson@intel.com> wrote:
>>>>>>> On Tue, Mar 12, 2019 at 10:57:55AM +0530, Thanneeru Srinivasulu 
>>>>>>> wrote:
>>>>>>>> Hi Everyone.
>>>>>>>>
>>>>>>>> I did attached pice  to Guest VM using vfio-pci with qemu 
>>>>>>>> command, and then
>>>>>>>> tried binding the pcie bdf with vfio-pci, observing binding 
>>>>>>>> failure with
>>>>>>>> vfio-pci.
>>>>>>>>
>>>>>>>> Where as when tryied with igb_uio, everything works fine.
>>>>>>>>
>>>>>>>> Does Binding with vfio-pci is supported inside VM/guest?
>>>>>>>>
>>>>>>> vfio support requires the presence of an IOMMU, and you 
>>>>>>> generally don't
>>>>>>> have an IOMMU available in a VM.
>>>>>>>
>>>>>>> /Bruce
>>>>>
>>>>>
>>>>> Actually, Qemu support vIOMMU + VFIO in guest[1], all you need is 
>>>>> to add a
>>>>> intel IOMMU and enabling caching mode.
>>>>>
>>>>> Thanks
>>>>>
>>>>>
>>>>> [1]
>>>>>
>>>>> https://www.lfasiallc.com/wp-content/uploads/2017/11/Device-Assignment-with-Nested-Guests-and-DPDK_Peter-Xu.pdf 
>>>>>
>>>>>
>>>> Thanks for the info.
>>>>
>>>> /Bruce
>>>>
>>>
>>> One more thing: even without vIOMMU, VFIO has no-IOMMU mode which 
>>> can be enabled (for a recent-enough kernel). This will make VFIO 
>>> work even in cases where the guest doesn't have IOMMU emulation. 
>>> See? There's no reason to use igb_uio, ever! :D
>>>
>>
>>
>
>


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

* Re: [dpdk-dev] Query : Does Binding with vfio-pci is supported inside qemu-kvm guest/vm instance.?
  2019-04-03  7:49               ` John Sucaet
  2019-04-03  7:49                 ` John Sucaet
@ 2019-04-03  7:54                 ` Maxime Coquelin
  2019-04-03  7:54                   ` Maxime Coquelin
  2019-04-04  8:23                   ` John Sucaet
  1 sibling, 2 replies; 17+ messages in thread
From: Maxime Coquelin @ 2019-04-03  7:54 UTC (permalink / raw)
  To: John Sucaet, Burakov, Anatoly, dev

Hi John,

On 4/3/19 9:49 AM, John Sucaet wrote:
> Thanks, Anatoly.
> 
> Maxime, could you enlighten me a bit? I basically would like to know 
> whether I should be able to make my 32-bit dpdk application work with 
> virtio-pci-net and vfio-pci (with a 64-bit kernel), or if I should do 
> the effort to port to 64-bit (which I would like to avoid for now).

I think that it should work, but that's not something I have tried.
I will try to reproduce it this week to get a precise idea of what is
going wrong.

Thanks for reporting the issue,
Maxime

> Thank you
> John
> 
> On 04/02/2019 03:38 PM, Burakov, Anatoly wrote:
>> On 02-Apr-19 11:38 AM, John Sucaet wrote:
>>> Hi Anatoly,
>>>
>>> As you said: There's no reason to use igb_uio, ever!
>>
>> That was partly tongue in cheek, but point taken :)
>>
>>> I would like to ask whether vfio-pci with or without vIOMMU 
>>> should/could work for virtio-pci net devices in the case of a 32-bit 
>>> dpdk application, on a 64-bit kernel (4.9) inside a guest VM 
>>> (qemu-2.10.2-1.fc27)?
>>>
>>> I tried both a 64-bit and a 32-bit version of the same application, 
>>> but only in the case of the 64-bit application, the port was found by 
>>> eal. The 32-bit application gave errors like:
>>>
>>> EAL: pci_map_resource(): cannot mmap(16, 0xf4a01000, 0x4000, 0x0): 
>>> Invalid argument (0xffffffff)
>>> EAL: Failed to map pci BAR4
>>> EAL:   0000:00:02.0 mapping BAR4 failed: Invalid argument
>>> EAL: Can't write to PCI bar (0) : offset (12)
>>> EAL: Can't read from PCI bar (0) : offset (12)
>>> EAL: Can't read from PCI bar (0) : offset (12)
>>> EAL: Can't write to PCI bar (0) : offset (12)
>>> EAL: Can't read from PCI bar (0) : offset (12)
>>> EAL: Can't write to PCI bar (0) : offset (12)
>>> EAL: Can't read from PCI bar (0) : offset (0)
>>> EAL: Can't write to PCI bar (0) : offset (4)
>>> EAL: Can't write to PCI bar (0) : offset (14)
>>> EAL: Can't read from PCI bar (0) : offset (14)
>>> EAL: Can't read from PCI bar (0) : offset (1a)
>>> EAL: Can't read from PCI bar (0) : offset (1c)
>>> EAL: Can't write to PCI bar (0) : offset (e)
>>> EAL: Can't read from PCI bar (0) : offset (c)
>>> virtio_init_queue(): virtqueue size is not powerof 2
>>> EAL: Requested device 0000:00:02.0 cannot be used
>>>
>>> Maybe you have an idea what went wrong here?
>>>
>>> By preference, I would like to continue to use the 32-bit application 
>>> which worked fine with the igb_uio driver.
>>
>> Unfortunately, i am not very familiar with virtio and wouldn't know 
>> whether it's supposed to work under these conditions. Perhaps Maxime 
>> would be of more help here (CC'd).
>>
>>>
>>>
>>> Thanks
>>>
>>> John
>>>
>>>
>>> On 03/12/2019 11:57 AM, Burakov, Anatoly wrote:
>>>> On 12-Mar-19 10:20 AM, Bruce Richardson wrote:
>>>>> On Tue, Mar 12, 2019 at 05:54:39PM +0800, Jason Wang wrote:
>>>>>>
>>>>>> On 2019/3/12 下午5:42, Thanneeru Srinivasulu wrote:
>>>>>>> Thanks Bruce..
>>>>>>>
>>>>>>> On Tue, Mar 12, 2019 at 3:08 PM Bruce Richardson
>>>>>>> <bruce.richardson@intel.com> wrote:
>>>>>>>> On Tue, Mar 12, 2019 at 10:57:55AM +0530, Thanneeru Srinivasulu 
>>>>>>>> wrote:
>>>>>>>>> Hi Everyone.
>>>>>>>>>
>>>>>>>>> I did attached pice  to Guest VM using vfio-pci with qemu 
>>>>>>>>> command, and then
>>>>>>>>> tried binding the pcie bdf with vfio-pci, observing binding 
>>>>>>>>> failure with
>>>>>>>>> vfio-pci.
>>>>>>>>>
>>>>>>>>> Where as when tryied with igb_uio, everything works fine.
>>>>>>>>>
>>>>>>>>> Does Binding with vfio-pci is supported inside VM/guest?
>>>>>>>>>
>>>>>>>> vfio support requires the presence of an IOMMU, and you 
>>>>>>>> generally don't
>>>>>>>> have an IOMMU available in a VM.
>>>>>>>>
>>>>>>>> /Bruce
>>>>>>
>>>>>>
>>>>>> Actually, Qemu support vIOMMU + VFIO in guest[1], all you need is 
>>>>>> to add a
>>>>>> intel IOMMU and enabling caching mode.
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>>>
>>>>>> [1]
>>>>>>
>>>>>> https://www.lfasiallc.com/wp-content/uploads/2017/11/Device-Assignment-with-Nested-Guests-and-DPDK_Peter-Xu.pdf 
>>>>>>
>>>>>>
>>>>> Thanks for the info.
>>>>>
>>>>> /Bruce
>>>>>
>>>>
>>>> One more thing: even without vIOMMU, VFIO has no-IOMMU mode which 
>>>> can be enabled (for a recent-enough kernel). This will make VFIO 
>>>> work even in cases where the guest doesn't have IOMMU emulation. 
>>>> See? There's no reason to use igb_uio, ever! :D
>>>>
>>>
>>>
>>
>>
> 

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

* Re: [dpdk-dev] Query : Does Binding with vfio-pci is supported inside qemu-kvm guest/vm instance.?
  2019-04-03  7:54                 ` Maxime Coquelin
@ 2019-04-03  7:54                   ` Maxime Coquelin
  2019-04-04  8:23                   ` John Sucaet
  1 sibling, 0 replies; 17+ messages in thread
From: Maxime Coquelin @ 2019-04-03  7:54 UTC (permalink / raw)
  To: John Sucaet, Burakov, Anatoly, dev

Hi John,

On 4/3/19 9:49 AM, John Sucaet wrote:
> Thanks, Anatoly.
> 
> Maxime, could you enlighten me a bit? I basically would like to know 
> whether I should be able to make my 32-bit dpdk application work with 
> virtio-pci-net and vfio-pci (with a 64-bit kernel), or if I should do 
> the effort to port to 64-bit (which I would like to avoid for now).

I think that it should work, but that's not something I have tried.
I will try to reproduce it this week to get a precise idea of what is
going wrong.

Thanks for reporting the issue,
Maxime

> Thank you
> John
> 
> On 04/02/2019 03:38 PM, Burakov, Anatoly wrote:
>> On 02-Apr-19 11:38 AM, John Sucaet wrote:
>>> Hi Anatoly,
>>>
>>> As you said: There's no reason to use igb_uio, ever!
>>
>> That was partly tongue in cheek, but point taken :)
>>
>>> I would like to ask whether vfio-pci with or without vIOMMU 
>>> should/could work for virtio-pci net devices in the case of a 32-bit 
>>> dpdk application, on a 64-bit kernel (4.9) inside a guest VM 
>>> (qemu-2.10.2-1.fc27)?
>>>
>>> I tried both a 64-bit and a 32-bit version of the same application, 
>>> but only in the case of the 64-bit application, the port was found by 
>>> eal. The 32-bit application gave errors like:
>>>
>>> EAL: pci_map_resource(): cannot mmap(16, 0xf4a01000, 0x4000, 0x0): 
>>> Invalid argument (0xffffffff)
>>> EAL: Failed to map pci BAR4
>>> EAL:   0000:00:02.0 mapping BAR4 failed: Invalid argument
>>> EAL: Can't write to PCI bar (0) : offset (12)
>>> EAL: Can't read from PCI bar (0) : offset (12)
>>> EAL: Can't read from PCI bar (0) : offset (12)
>>> EAL: Can't write to PCI bar (0) : offset (12)
>>> EAL: Can't read from PCI bar (0) : offset (12)
>>> EAL: Can't write to PCI bar (0) : offset (12)
>>> EAL: Can't read from PCI bar (0) : offset (0)
>>> EAL: Can't write to PCI bar (0) : offset (4)
>>> EAL: Can't write to PCI bar (0) : offset (14)
>>> EAL: Can't read from PCI bar (0) : offset (14)
>>> EAL: Can't read from PCI bar (0) : offset (1a)
>>> EAL: Can't read from PCI bar (0) : offset (1c)
>>> EAL: Can't write to PCI bar (0) : offset (e)
>>> EAL: Can't read from PCI bar (0) : offset (c)
>>> virtio_init_queue(): virtqueue size is not powerof 2
>>> EAL: Requested device 0000:00:02.0 cannot be used
>>>
>>> Maybe you have an idea what went wrong here?
>>>
>>> By preference, I would like to continue to use the 32-bit application 
>>> which worked fine with the igb_uio driver.
>>
>> Unfortunately, i am not very familiar with virtio and wouldn't know 
>> whether it's supposed to work under these conditions. Perhaps Maxime 
>> would be of more help here (CC'd).
>>
>>>
>>>
>>> Thanks
>>>
>>> John
>>>
>>>
>>> On 03/12/2019 11:57 AM, Burakov, Anatoly wrote:
>>>> On 12-Mar-19 10:20 AM, Bruce Richardson wrote:
>>>>> On Tue, Mar 12, 2019 at 05:54:39PM +0800, Jason Wang wrote:
>>>>>>
>>>>>> On 2019/3/12 下午5:42, Thanneeru Srinivasulu wrote:
>>>>>>> Thanks Bruce..
>>>>>>>
>>>>>>> On Tue, Mar 12, 2019 at 3:08 PM Bruce Richardson
>>>>>>> <bruce.richardson@intel.com> wrote:
>>>>>>>> On Tue, Mar 12, 2019 at 10:57:55AM +0530, Thanneeru Srinivasulu 
>>>>>>>> wrote:
>>>>>>>>> Hi Everyone.
>>>>>>>>>
>>>>>>>>> I did attached pice  to Guest VM using vfio-pci with qemu 
>>>>>>>>> command, and then
>>>>>>>>> tried binding the pcie bdf with vfio-pci, observing binding 
>>>>>>>>> failure with
>>>>>>>>> vfio-pci.
>>>>>>>>>
>>>>>>>>> Where as when tryied with igb_uio, everything works fine.
>>>>>>>>>
>>>>>>>>> Does Binding with vfio-pci is supported inside VM/guest?
>>>>>>>>>
>>>>>>>> vfio support requires the presence of an IOMMU, and you 
>>>>>>>> generally don't
>>>>>>>> have an IOMMU available in a VM.
>>>>>>>>
>>>>>>>> /Bruce
>>>>>>
>>>>>>
>>>>>> Actually, Qemu support vIOMMU + VFIO in guest[1], all you need is 
>>>>>> to add a
>>>>>> intel IOMMU and enabling caching mode.
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>>>
>>>>>> [1]
>>>>>>
>>>>>> https://www.lfasiallc.com/wp-content/uploads/2017/11/Device-Assignment-with-Nested-Guests-and-DPDK_Peter-Xu.pdf 
>>>>>>
>>>>>>
>>>>> Thanks for the info.
>>>>>
>>>>> /Bruce
>>>>>
>>>>
>>>> One more thing: even without vIOMMU, VFIO has no-IOMMU mode which 
>>>> can be enabled (for a recent-enough kernel). This will make VFIO 
>>>> work even in cases where the guest doesn't have IOMMU emulation. 
>>>> See? There's no reason to use igb_uio, ever! :D
>>>>
>>>
>>>
>>
>>
> 

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

* Re: [dpdk-dev] Query : Does Binding with vfio-pci is supported inside qemu-kvm guest/vm instance.?
  2019-04-03  7:54                 ` Maxime Coquelin
  2019-04-03  7:54                   ` Maxime Coquelin
@ 2019-04-04  8:23                   ` John Sucaet
  2019-04-04  8:23                     ` John Sucaet
  1 sibling, 1 reply; 17+ messages in thread
From: John Sucaet @ 2019-04-04  8:23 UTC (permalink / raw)
  To: Maxime Coquelin, Burakov, Anatoly, dev

Hi Maxime,

Thanks for your answer. I want to add that I have this problem both with 
18.08 and 18.11. Also I am using qemu with machine type pc-q35-2.10 (and 
pcie-root). When I change it to machine type pc-i440fx-2.4 (and 
pci-root), I don't see the problem. Ports are in that case, detected in 
the 32-bit dpdk application, as expected.

Hope this helps in finding a reason why mmap failed.

Thanks

John

On 04/03/2019 09:54 AM, Maxime Coquelin wrote:
> Hi John,
>
> On 4/3/19 9:49 AM, John Sucaet wrote:
>> Thanks, Anatoly.
>>
>> Maxime, could you enlighten me a bit? I basically would like to know 
>> whether I should be able to make my 32-bit dpdk application work with 
>> virtio-pci-net and vfio-pci (with a 64-bit kernel), or if I should do 
>> the effort to port to 64-bit (which I would like to avoid for now).
>
> I think that it should work, but that's not something I have tried.
> I will try to reproduce it this week to get a precise idea of what is
> going wrong.
>
> Thanks for reporting the issue,
> Maxime
>
>> Thank you
>> John
>>
>> On 04/02/2019 03:38 PM, Burakov, Anatoly wrote:
>>> On 02-Apr-19 11:38 AM, John Sucaet wrote:
>>>> Hi Anatoly,
>>>>
>>>> As you said: There's no reason to use igb_uio, ever!
>>>
>>> That was partly tongue in cheek, but point taken :)
>>>
>>>> I would like to ask whether vfio-pci with or without vIOMMU 
>>>> should/could work for virtio-pci net devices in the case of a 
>>>> 32-bit dpdk application, on a 64-bit kernel (4.9) inside a guest VM 
>>>> (qemu-2.10.2-1.fc27)?
>>>>
>>>> I tried both a 64-bit and a 32-bit version of the same application, 
>>>> but only in the case of the 64-bit application, the port was found 
>>>> by eal. The 32-bit application gave errors like:
>>>>
>>>> EAL: pci_map_resource(): cannot mmap(16, 0xf4a01000, 0x4000, 0x0): 
>>>> Invalid argument (0xffffffff)
>>>> EAL: Failed to map pci BAR4
>>>> EAL:   0000:00:02.0 mapping BAR4 failed: Invalid argument
>>>> EAL: Can't write to PCI bar (0) : offset (12)
>>>> EAL: Can't read from PCI bar (0) : offset (12)
>>>> EAL: Can't read from PCI bar (0) : offset (12)
>>>> EAL: Can't write to PCI bar (0) : offset (12)
>>>> EAL: Can't read from PCI bar (0) : offset (12)
>>>> EAL: Can't write to PCI bar (0) : offset (12)
>>>> EAL: Can't read from PCI bar (0) : offset (0)
>>>> EAL: Can't write to PCI bar (0) : offset (4)
>>>> EAL: Can't write to PCI bar (0) : offset (14)
>>>> EAL: Can't read from PCI bar (0) : offset (14)
>>>> EAL: Can't read from PCI bar (0) : offset (1a)
>>>> EAL: Can't read from PCI bar (0) : offset (1c)
>>>> EAL: Can't write to PCI bar (0) : offset (e)
>>>> EAL: Can't read from PCI bar (0) : offset (c)
>>>> virtio_init_queue(): virtqueue size is not powerof 2
>>>> EAL: Requested device 0000:00:02.0 cannot be used
>>>>
>>>> Maybe you have an idea what went wrong here?
>>>>
>>>> By preference, I would like to continue to use the 32-bit 
>>>> application which worked fine with the igb_uio driver.
>>>
>>> Unfortunately, i am not very familiar with virtio and wouldn't know 
>>> whether it's supposed to work under these conditions. Perhaps Maxime 
>>> would be of more help here (CC'd).
>>>
>>>>
>>>>
>>>> Thanks
>>>>
>>>> John
>>>>
>>>>
>>>> On 03/12/2019 11:57 AM, Burakov, Anatoly wrote:
>>>>> On 12-Mar-19 10:20 AM, Bruce Richardson wrote:
>>>>>> On Tue, Mar 12, 2019 at 05:54:39PM +0800, Jason Wang wrote:
>>>>>>>
>>>>>>> On 2019/3/12 下午5:42, Thanneeru Srinivasulu wrote:
>>>>>>>> Thanks Bruce..
>>>>>>>>
>>>>>>>> On Tue, Mar 12, 2019 at 3:08 PM Bruce Richardson
>>>>>>>> <bruce.richardson@intel.com> wrote:
>>>>>>>>> On Tue, Mar 12, 2019 at 10:57:55AM +0530, Thanneeru 
>>>>>>>>> Srinivasulu wrote:
>>>>>>>>>> Hi Everyone.
>>>>>>>>>>
>>>>>>>>>> I did attached pice  to Guest VM using vfio-pci with qemu 
>>>>>>>>>> command, and then
>>>>>>>>>> tried binding the pcie bdf with vfio-pci, observing binding 
>>>>>>>>>> failure with
>>>>>>>>>> vfio-pci.
>>>>>>>>>>
>>>>>>>>>> Where as when tryied with igb_uio, everything works fine.
>>>>>>>>>>
>>>>>>>>>> Does Binding with vfio-pci is supported inside VM/guest?
>>>>>>>>>>
>>>>>>>>> vfio support requires the presence of an IOMMU, and you 
>>>>>>>>> generally don't
>>>>>>>>> have an IOMMU available in a VM.
>>>>>>>>>
>>>>>>>>> /Bruce
>>>>>>>
>>>>>>>
>>>>>>> Actually, Qemu support vIOMMU + VFIO in guest[1], all you need 
>>>>>>> is to add a
>>>>>>> intel IOMMU and enabling caching mode.
>>>>>>>
>>>>>>> Thanks
>>>>>>>
>>>>>>>
>>>>>>> [1]
>>>>>>>
>>>>>>> https://www.lfasiallc.com/wp-content/uploads/2017/11/Device-Assignment-with-Nested-Guests-and-DPDK_Peter-Xu.pdf 
>>>>>>>
>>>>>>>
>>>>>> Thanks for the info.
>>>>>>
>>>>>> /Bruce
>>>>>>
>>>>>
>>>>> One more thing: even without vIOMMU, VFIO has no-IOMMU mode which 
>>>>> can be enabled (for a recent-enough kernel). This will make VFIO 
>>>>> work even in cases where the guest doesn't have IOMMU emulation. 
>>>>> See? There's no reason to use igb_uio, ever! :D
>>>>>
>>>>
>>>>
>>>
>>>
>>
> .
>

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

* Re: [dpdk-dev] Query : Does Binding with vfio-pci is supported inside qemu-kvm guest/vm instance.?
  2019-04-04  8:23                   ` John Sucaet
@ 2019-04-04  8:23                     ` John Sucaet
  0 siblings, 0 replies; 17+ messages in thread
From: John Sucaet @ 2019-04-04  8:23 UTC (permalink / raw)
  To: Maxime Coquelin, Burakov, Anatoly, dev

Hi Maxime,

Thanks for your answer. I want to add that I have this problem both with 
18.08 and 18.11. Also I am using qemu with machine type pc-q35-2.10 (and 
pcie-root). When I change it to machine type pc-i440fx-2.4 (and 
pci-root), I don't see the problem. Ports are in that case, detected in 
the 32-bit dpdk application, as expected.

Hope this helps in finding a reason why mmap failed.

Thanks

John

On 04/03/2019 09:54 AM, Maxime Coquelin wrote:
> Hi John,
>
> On 4/3/19 9:49 AM, John Sucaet wrote:
>> Thanks, Anatoly.
>>
>> Maxime, could you enlighten me a bit? I basically would like to know 
>> whether I should be able to make my 32-bit dpdk application work with 
>> virtio-pci-net and vfio-pci (with a 64-bit kernel), or if I should do 
>> the effort to port to 64-bit (which I would like to avoid for now).
>
> I think that it should work, but that's not something I have tried.
> I will try to reproduce it this week to get a precise idea of what is
> going wrong.
>
> Thanks for reporting the issue,
> Maxime
>
>> Thank you
>> John
>>
>> On 04/02/2019 03:38 PM, Burakov, Anatoly wrote:
>>> On 02-Apr-19 11:38 AM, John Sucaet wrote:
>>>> Hi Anatoly,
>>>>
>>>> As you said: There's no reason to use igb_uio, ever!
>>>
>>> That was partly tongue in cheek, but point taken :)
>>>
>>>> I would like to ask whether vfio-pci with or without vIOMMU 
>>>> should/could work for virtio-pci net devices in the case of a 
>>>> 32-bit dpdk application, on a 64-bit kernel (4.9) inside a guest VM 
>>>> (qemu-2.10.2-1.fc27)?
>>>>
>>>> I tried both a 64-bit and a 32-bit version of the same application, 
>>>> but only in the case of the 64-bit application, the port was found 
>>>> by eal. The 32-bit application gave errors like:
>>>>
>>>> EAL: pci_map_resource(): cannot mmap(16, 0xf4a01000, 0x4000, 0x0): 
>>>> Invalid argument (0xffffffff)
>>>> EAL: Failed to map pci BAR4
>>>> EAL:   0000:00:02.0 mapping BAR4 failed: Invalid argument
>>>> EAL: Can't write to PCI bar (0) : offset (12)
>>>> EAL: Can't read from PCI bar (0) : offset (12)
>>>> EAL: Can't read from PCI bar (0) : offset (12)
>>>> EAL: Can't write to PCI bar (0) : offset (12)
>>>> EAL: Can't read from PCI bar (0) : offset (12)
>>>> EAL: Can't write to PCI bar (0) : offset (12)
>>>> EAL: Can't read from PCI bar (0) : offset (0)
>>>> EAL: Can't write to PCI bar (0) : offset (4)
>>>> EAL: Can't write to PCI bar (0) : offset (14)
>>>> EAL: Can't read from PCI bar (0) : offset (14)
>>>> EAL: Can't read from PCI bar (0) : offset (1a)
>>>> EAL: Can't read from PCI bar (0) : offset (1c)
>>>> EAL: Can't write to PCI bar (0) : offset (e)
>>>> EAL: Can't read from PCI bar (0) : offset (c)
>>>> virtio_init_queue(): virtqueue size is not powerof 2
>>>> EAL: Requested device 0000:00:02.0 cannot be used
>>>>
>>>> Maybe you have an idea what went wrong here?
>>>>
>>>> By preference, I would like to continue to use the 32-bit 
>>>> application which worked fine with the igb_uio driver.
>>>
>>> Unfortunately, i am not very familiar with virtio and wouldn't know 
>>> whether it's supposed to work under these conditions. Perhaps Maxime 
>>> would be of more help here (CC'd).
>>>
>>>>
>>>>
>>>> Thanks
>>>>
>>>> John
>>>>
>>>>
>>>> On 03/12/2019 11:57 AM, Burakov, Anatoly wrote:
>>>>> On 12-Mar-19 10:20 AM, Bruce Richardson wrote:
>>>>>> On Tue, Mar 12, 2019 at 05:54:39PM +0800, Jason Wang wrote:
>>>>>>>
>>>>>>> On 2019/3/12 下午5:42, Thanneeru Srinivasulu wrote:
>>>>>>>> Thanks Bruce..
>>>>>>>>
>>>>>>>> On Tue, Mar 12, 2019 at 3:08 PM Bruce Richardson
>>>>>>>> <bruce.richardson@intel.com> wrote:
>>>>>>>>> On Tue, Mar 12, 2019 at 10:57:55AM +0530, Thanneeru 
>>>>>>>>> Srinivasulu wrote:
>>>>>>>>>> Hi Everyone.
>>>>>>>>>>
>>>>>>>>>> I did attached pice  to Guest VM using vfio-pci with qemu 
>>>>>>>>>> command, and then
>>>>>>>>>> tried binding the pcie bdf with vfio-pci, observing binding 
>>>>>>>>>> failure with
>>>>>>>>>> vfio-pci.
>>>>>>>>>>
>>>>>>>>>> Where as when tryied with igb_uio, everything works fine.
>>>>>>>>>>
>>>>>>>>>> Does Binding with vfio-pci is supported inside VM/guest?
>>>>>>>>>>
>>>>>>>>> vfio support requires the presence of an IOMMU, and you 
>>>>>>>>> generally don't
>>>>>>>>> have an IOMMU available in a VM.
>>>>>>>>>
>>>>>>>>> /Bruce
>>>>>>>
>>>>>>>
>>>>>>> Actually, Qemu support vIOMMU + VFIO in guest[1], all you need 
>>>>>>> is to add a
>>>>>>> intel IOMMU and enabling caching mode.
>>>>>>>
>>>>>>> Thanks
>>>>>>>
>>>>>>>
>>>>>>> [1]
>>>>>>>
>>>>>>> https://www.lfasiallc.com/wp-content/uploads/2017/11/Device-Assignment-with-Nested-Guests-and-DPDK_Peter-Xu.pdf 
>>>>>>>
>>>>>>>
>>>>>> Thanks for the info.
>>>>>>
>>>>>> /Bruce
>>>>>>
>>>>>
>>>>> One more thing: even without vIOMMU, VFIO has no-IOMMU mode which 
>>>>> can be enabled (for a recent-enough kernel). This will make VFIO 
>>>>> work even in cases where the guest doesn't have IOMMU emulation. 
>>>>> See? There's no reason to use igb_uio, ever! :D
>>>>>
>>>>
>>>>
>>>
>>>
>>
> .
>


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

end of thread, other threads:[~2019-04-04  8:23 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-12  5:27 [dpdk-dev] Query : Does Binding with vfio-pci is supported inside qemu-kvm guest/vm instance.? Thanneeru Srinivasulu
2019-03-12  9:38 ` Bruce Richardson
2019-03-12  9:42   ` Thanneeru Srinivasulu
2019-03-12  9:54     ` Jason Wang
2019-03-12 10:20       ` Bruce Richardson
2019-03-12 10:57         ` Burakov, Anatoly
     [not found]           ` <CGME20190312110957eucas1p1af74c8d26bf80fd815847ed8086a1e78@eucas1p1.samsung.com>
2019-03-12 11:09             ` Ilya Maximets
2019-04-02 10:38           ` John Sucaet
2019-04-02 10:38             ` John Sucaet
2019-04-02 13:38             ` Burakov, Anatoly
2019-04-02 13:38               ` Burakov, Anatoly
2019-04-03  7:49               ` John Sucaet
2019-04-03  7:49                 ` John Sucaet
2019-04-03  7:54                 ` Maxime Coquelin
2019-04-03  7:54                   ` Maxime Coquelin
2019-04-04  8:23                   ` John Sucaet
2019-04-04  8:23                     ` John Sucaet

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).