vhost: fix external buffer in VDUSE
PATCH 1/1 vhost: fix external buffer in VDUSE
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.
--- lib/vhost/socket.c | 3 ++- lib/vhost/vduse.c | 8 +++++++- lib/vhost/vduse.h | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-)
lib/vhost/socket.c +2 -1
@@ -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" );
lib/vhost/vduse.c +7 -1
@@ -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;
lib/vhost/vduse.h +1 -1
@@ -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 */
Signature · 1 line
2.51.0
Quoted 13 lines · David Marchand
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")
Quoted 7 lines
Signed-off-by David Marchand <[email protected]>--- 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!
Maxime
Maxime Coquelin
AppliedQuoted 13 lines · David Marchand
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")
Quoted 7 lines
Signed-off-by David Marchand <[email protected]>--- lib/vhost/socket.c | 3 ++- lib/vhost/vduse.c | 8 +++++++- lib/vhost/vduse.h | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-)
Applied to next-virtio/for-net-next.
Thanks,
Maxime