From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: jmeng@redhat.com, stable@dpdk.org,
Maxime Coquelin <maxime.coquelin@redhat.com>,
Chenbo Xia <chenbox@nvidia.com>
Subject: [PATCH] vhost: fix external buffer in VDUSE
Date: Tue, 28 Oct 2025 13:34:53 +0100 [thread overview]
Message-ID: <20251028123453.4127525-1-david.marchand@redhat.com> (raw)
extbuf and linearbuf features are required for (enhanced) TSO support
in OVS.
VDUSE ports were generating multi-segments mbufs in case of "TSO"
buffers which resulted in OVS generating wrong packets after tunnel
encapsulation.
Enable the missing datapath features.
Fixes: 0adb8eccc6a6 ("vhost: add VDUSE device creation and destruction")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
lib/vhost/socket.c | 3 ++-
lib/vhost/vduse.c | 8 +++++++-
lib/vhost/vduse.h | 2 +-
3 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/lib/vhost/socket.c b/lib/vhost/socket.c
index 9b4f332f94..ae95e7e6b0 100644
--- a/lib/vhost/socket.c
+++ b/lib/vhost/socket.c
@@ -1194,7 +1194,8 @@ rte_vhost_driver_start(const char *path)
return -1;
if (vsocket->is_vduse)
- return vduse_device_create(path, vsocket->net_compliant_ol_flags);
+ return vduse_device_create(path, vsocket->net_compliant_ol_flags,
+ vsocket->extbuf, vsocket->linearbuf);
if (vhost_user.fdset == NULL) {
vhost_user.fdset = fdset_init("vhost-evt");
diff --git a/lib/vhost/vduse.c b/lib/vhost/vduse.c
index 68e56843fd..897dee9f1b 100644
--- a/lib/vhost/vduse.c
+++ b/lib/vhost/vduse.c
@@ -672,7 +672,7 @@ vduse_reconnect_start_device(struct virtio_net *dev)
}
int
-vduse_device_create(const char *path, bool compliant_ol_flags)
+vduse_device_create(const char *path, bool compliant_ol_flags, bool extbuf, bool linearbuf)
{
int control_fd, dev_fd, vid, ret;
uint32_t i, max_queue_pairs, total_queues;
@@ -817,6 +817,12 @@ vduse_device_create(const char *path, bool compliant_ol_flags)
vhost_setup_virtio_net(dev->vid, true, compliant_ol_flags, true, true);
+ if (extbuf)
+ vhost_enable_extbuf(dev->vid);
+
+ if (linearbuf)
+ vhost_enable_linearbuf(dev->vid);
+
for (i = 0; i < total_queues; i++) {
struct vduse_vq_config vq_cfg = { 0 };
struct vhost_virtqueue *vq;
diff --git a/lib/vhost/vduse.h b/lib/vhost/vduse.h
index 47ca97a064..b2515bb9df 100644
--- a/lib/vhost/vduse.h
+++ b/lib/vhost/vduse.h
@@ -9,7 +9,7 @@
#define VDUSE_NET_SUPPORTED_FEATURES VIRTIO_NET_SUPPORTED_FEATURES
-int vduse_device_create(const char *path, bool compliant_ol_flags);
+int vduse_device_create(const char *path, bool compliant_ol_flags, bool extbuf, bool linearbuf);
int vduse_device_destroy(const char *path);
#endif /* _VDUSE_H */
--
2.51.0
next reply other threads:[~2025-10-28 12:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-28 12:34 David Marchand [this message]
2025-10-28 12:56 ` 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=20251028123453.4127525-1-david.marchand@redhat.com \
--to=david.marchand@redhat.com \
--cc=chenbox@nvidia.com \
--cc=dev@dpdk.org \
--cc=jmeng@redhat.com \
--cc=maxime.coquelin@redhat.com \
--cc=stable@dpdk.org \
/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).