DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] cannot use virtio-user pmd in IOVA=PA mode anymore
@ 2021-09-24  8:21 Olivier Matz
  2021-09-29  9:27 ` Maxime Coquelin
  0 siblings, 1 reply; 2+ messages in thread
From: Olivier Matz @ 2021-09-24  8:21 UTC (permalink / raw)
  To: dev, Maxime Coquelin, Chenbo Xia; +Cc: David Marchand

Hello,

I recently tested a use-case with our application using the main
branch of dpdk.org.

- the application runs inside a standard x86 VM (no IOMMU)
- there are emulated physical NICs inside the VM
- we use virtio-user pmds connected to tap interfaces through the
  vhost-net backend for exception path

This use-case works with the the stable 20.11 branch, but not with the
current main dpdk.org branch. The virtio-user driver refuses to start in
IOVA=PA mode:

  vdev_probe_all_drivers(): virtio_user0 requires VA IOVA mode but current mode is PA, not initializing
  EAL: Driver cannot attach the device (virtio_user0)

This is likely due to these commits:

  8d935fff5546 ("bus/vdev: add driver IOVA VA mode requirement")
  17043a2909bb ("net/virtio: force IOVA as VA mode for virtio-user")

We didn't see this problem before because we are only testing dpdk.org
main branch on physical machines that have an IOMMU.

I'm not sure to understand the reasons for which the ability to run a
virtio-user pmd in IOVA=PA mode was removed.

The commitlog of 17043a2909bb says:

  At least Vhost-user backend of Virtio-user PMD requires
  IOVA as VA mode. Until now, it was implemented as a hack
  by forcing to use mbuf's buf_addr field instead of buf_iova.

I don't get why vhost-user backend would require IOVA=VA. Note that we
also have a use-case where a virtio-user pmd is connected to our
pmd-vhost in another application, which was working with 20.11.

If there is a constraint with vhost-user backend, what about vhost-net
backend?

Would it make sense to re-allow this feature by somehow reverting
17043a2909bb with some additional cleanup?

I am aware that a solution can be to configure qemu to enable a vIOMMU,
but it is not my preferred solution yet, as it would impact our users
that do not do this currently.

Thanks!
Olivier

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

* Re: [dpdk-dev] cannot use virtio-user pmd in IOVA=PA mode anymore
  2021-09-24  8:21 [dpdk-dev] cannot use virtio-user pmd in IOVA=PA mode anymore Olivier Matz
@ 2021-09-29  9:27 ` Maxime Coquelin
  0 siblings, 0 replies; 2+ messages in thread
From: Maxime Coquelin @ 2021-09-29  9:27 UTC (permalink / raw)
  To: Olivier Matz, dev, Chenbo Xia; +Cc: David Marchand

Hi Olivier,

On 9/24/21 10:21, Olivier Matz wrote:
> Hello,
> 
> I recently tested a use-case with our application using the main
> branch of dpdk.org.
> 
> - the application runs inside a standard x86 VM (no IOMMU)
> - there are emulated physical NICs inside the VM
> - we use virtio-user pmds connected to tap interfaces through the
>    vhost-net backend for exception path
> 
> This use-case works with the the stable 20.11 branch, but not with the
> current main dpdk.org branch. The virtio-user driver refuses to start in
> IOVA=PA mode:
> 
>    vdev_probe_all_drivers(): virtio_user0 requires VA IOVA mode but current mode is PA, not initializing
>    EAL: Driver cannot attach the device (virtio_user0)
> 
> This is likely due to these commits:
> 
>    8d935fff5546 ("bus/vdev: add driver IOVA VA mode requirement")
>    17043a2909bb ("net/virtio: force IOVA as VA mode for virtio-user")
> 
> We didn't see this problem before because we are only testing dpdk.org
> main branch on physical machines that have an IOMMU.
> 
> I'm not sure to understand the reasons for which the ability to run a
> virtio-user pmd in IOVA=PA mode was removed.
> 
> The commitlog of 17043a2909bb says:
> 
>    At least Vhost-user backend of Virtio-user PMD requires
>    IOVA as VA mode. Until now, it was implemented as a hack
>    by forcing to use mbuf's buf_addr field instead of buf_iova.
> 
> I don't get why vhost-user backend would require IOVA=VA. Note that we
> also have a use-case where a virtio-user pmd is connected to our
> pmd-vhost in another application, which was working with 20.11.
> 
> If there is a constraint with vhost-user backend, what about vhost-net
> backend?
> 
> Would it make sense to re-allow this feature by somehow reverting
> 17043a2909bb with some additional cleanup?

I think so.

> I am aware that a solution can be to configure qemu to enable a vIOMMU,
> but it is not my preferred solution yet, as it would impact our users
> that do not do this currently.

The initial purpose of this change was to simplify the code, I did not 
thought about this adverse side-effect.

While moving to VFIO with IOMMU enabled would be a wise decision :), I
will work on reverting that patch to restore the old behavior as that
was not something that was agreed when the patch was submitted.

Thanks for reporting the issue,
Maxime

> Thanks!
> Olivier
> 


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

end of thread, other threads:[~2021-09-29  9:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-24  8:21 [dpdk-dev] cannot use virtio-user pmd in IOVA=PA mode anymore Olivier Matz
2021-09-29  9:27 ` Maxime Coquelin

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