DPDK patches and discussions
 help / color / mirror / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: dev@dpdk.org, david.marchand@redhat.com, thomas@monjalon.net,
	chenbo.xia@intel.com, aconole@redhat.com, ktraynor@redhat.com
Cc: Maxime Coquelin <maxime.coquelin@redhat.com>
Subject: [PATCH v2 2/2] vhost: force vIOMMU enablement with VDUSE
Date: Thu, 13 Jul 2023 13:29:05 +0200	[thread overview]
Message-ID: <20230713112905.233306-3-maxime.coquelin@redhat.com> (raw)
In-Reply-To: <20230713112905.233306-1-maxime.coquelin@redhat.com>

Unlike Vhost-user, VDUSE requires vIOMMU support.
This patch ignores whether RTE_VHOST_USER_IOMMU_SUPPORT
flag is passed at register time to avoid having application
to pass it for having working VDUSE device creation.

Fixes: 0adb8eccc6a6 ("vhost: add VDUSE device creation and destruction")

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 lib/vhost/socket.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/vhost/socket.c b/lib/vhost/socket.c
index 57dfe3d2fe..79f2138f60 100644
--- a/lib/vhost/socket.c
+++ b/lib/vhost/socket.c
@@ -932,7 +932,10 @@ rte_vhost_driver_register(const char *path, uint64_t flags)
 	vsocket->async_copy = flags & RTE_VHOST_USER_ASYNC_COPY;
 	vsocket->net_compliant_ol_flags = flags & RTE_VHOST_USER_NET_COMPLIANT_OL_FLAGS;
 	vsocket->stats_enabled = flags & RTE_VHOST_USER_NET_STATS_ENABLE;
-	vsocket->iommu_support = flags & RTE_VHOST_USER_IOMMU_SUPPORT;
+	if (vsocket->is_vduse)
+		vsocket->iommu_support = true;
+	else
+		vsocket->iommu_support = flags & RTE_VHOST_USER_IOMMU_SUPPORT;
 
 	if (vsocket->async_copy &&
 		(flags & (RTE_VHOST_USER_IOMMU_SUPPORT |
@@ -986,7 +989,7 @@ rte_vhost_driver_register(const char *path, uint64_t flags)
 		vsocket->features &= ~seg_offload_features;
 	}
 
-	if (!(flags & RTE_VHOST_USER_IOMMU_SUPPORT)) {
+	if (!vsocket->iommu_support) {
 		vsocket->supported_features &= ~(1ULL << VIRTIO_F_IOMMU_PLATFORM);
 		vsocket->features &= ~(1ULL << VIRTIO_F_IOMMU_PLATFORM);
 	}
-- 
2.41.0


  parent reply	other threads:[~2023-07-13 11:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-13 11:29 [PATCH v2 0/2] vduse: TSO & vIOMMU fixes Maxime Coquelin
2023-07-13 11:29 ` [PATCH v2 1/2] vhost: fix net offload compliance Maxime Coquelin
2023-07-13 11:29 ` Maxime Coquelin [this message]
2023-07-13 12:47   ` [PATCH v2 2/2] vhost: force vIOMMU enablement with VDUSE Kevin Traynor
2023-07-13 13:42     ` Maxime Coquelin

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=20230713112905.233306-3-maxime.coquelin@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=aconole@redhat.com \
    --cc=chenbo.xia@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=ktraynor@redhat.com \
    --cc=thomas@monjalon.net \
    /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).