DPDK patches and discussions
 help / color / mirror / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: Olivier Matz <olivier.matz@6wind.com>,
	dev@dpdk.org, Chenbo Xia <chenbo.xia@intel.com>
Cc: David Marchand <david.marchand@redhat.com>
Subject: Re: [dpdk-dev] cannot use virtio-user pmd in IOVA=PA mode anymore
Date: Wed, 29 Sep 2021 11:27:40 +0200	[thread overview]
Message-ID: <8f07939a-1caf-eb1e-7da9-b624bde2800e@redhat.com> (raw)
In-Reply-To: <YU2KkXoPkZa2QrCe@platinum>

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
> 


      reply	other threads:[~2021-09-29  9:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-24  8:21 Olivier Matz
2021-09-29  9:27 ` Maxime Coquelin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8f07939a-1caf-eb1e-7da9-b624bde2800e@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=chenbo.xia@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=olivier.matz@6wind.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).