Skip to content

Commit 8ae4f1d

Browse files
david-marchandmcoquelin
authored andcommitted
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. Fixes: 0adb8ec ("vhost: add VDUSE device creation and destruction") Cc: [email protected] Signed-off-by: David Marchand <[email protected]> Reviewed-by: Maxime Coquelin <[email protected]>
1 parent b8caeff commit 8ae4f1d

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

lib/vhost/socket.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1194,7 +1194,8 @@ rte_vhost_driver_start(const char *path)
11941194
return -1;
11951195

11961196
if (vsocket->is_vduse)
1197-
return vduse_device_create(path, vsocket->net_compliant_ol_flags);
1197+
return vduse_device_create(path, vsocket->net_compliant_ol_flags,
1198+
vsocket->extbuf, vsocket->linearbuf);
11981199

11991200
if (vhost_user.fdset == NULL) {
12001201
vhost_user.fdset = fdset_init("vhost-evt");

lib/vhost/vduse.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ vduse_reconnect_start_device(struct virtio_net *dev)
672672
}
673673

674674
int
675-
vduse_device_create(const char *path, bool compliant_ol_flags)
675+
vduse_device_create(const char *path, bool compliant_ol_flags, bool extbuf, bool linearbuf)
676676
{
677677
int control_fd, dev_fd, vid, ret;
678678
uint32_t i, max_queue_pairs, total_queues;
@@ -817,6 +817,12 @@ vduse_device_create(const char *path, bool compliant_ol_flags)
817817

818818
vhost_setup_virtio_net(dev->vid, true, compliant_ol_flags, true, true);
819819

820+
if (extbuf)
821+
vhost_enable_extbuf(dev->vid);
822+
823+
if (linearbuf)
824+
vhost_enable_linearbuf(dev->vid);
825+
820826
for (i = 0; i < total_queues; i++) {
821827
struct vduse_vq_config vq_cfg = { 0 };
822828
struct vhost_virtqueue *vq;

lib/vhost/vduse.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#define VDUSE_NET_SUPPORTED_FEATURES VIRTIO_NET_SUPPORTED_FEATURES
1111

12-
int vduse_device_create(const char *path, bool compliant_ol_flags);
12+
int vduse_device_create(const char *path, bool compliant_ol_flags, bool extbuf, bool linearbuf);
1313
int vduse_device_destroy(const char *path);
1414

1515
#endif /* _VDUSE_H */

0 commit comments

Comments
 (0)