DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] vhost: fix external buffer in VDUSE
@ 2025-10-28 12:34 David Marchand
  2025-10-28 12:56 ` Maxime Coquelin
  0 siblings, 1 reply; 2+ messages in thread
From: David Marchand @ 2025-10-28 12:34 UTC (permalink / raw)
  To: dev; +Cc: jmeng, stable, Maxime Coquelin, Chenbo Xia

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


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

* Re: [PATCH] vhost: fix external buffer in VDUSE
  2025-10-28 12:34 [PATCH] vhost: fix external buffer in VDUSE David Marchand
@ 2025-10-28 12:56 ` Maxime Coquelin
  0 siblings, 0 replies; 2+ messages in thread
From: Maxime Coquelin @ 2025-10-28 12:56 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, jmeng, stable, Maxime Coquelin, Chenbo Xia

On Tue, Oct 28, 2025 at 1:35 PM David Marchand
<david.marchand@redhat.com> wrote:
>
> 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(-)
>

Thanks for working on this!

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Maxime


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

end of thread, other threads:[~2025-10-28 12:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-28 12:34 [PATCH] vhost: fix external buffer in VDUSE David Marchand
2025-10-28 12:56 ` 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).