[v3,1/2] vhost: fix net offload compliance
Checks
Commit Message
Initial VDUSE support assumed the application always used
the net offload compliant mode, which is not the case for
OVS.
This patch propagates the value set by the application.
Fixes: 0adb8eccc6a6 ("vhost: add VDUSE device creation and destruction")
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
lib/vhost/socket.c | 2 +-
lib/vhost/vduse.c | 4 ++--
lib/vhost/vduse.h | 6 ++++--
3 files changed, 7 insertions(+), 5 deletions(-)
Comments
On 13/07/2023 14:52, Maxime Coquelin wrote:
> Initial VDUSE support assumed the application always used
> the net offload compliant mode, which is not the case for
> OVS.
>
> This patch propagates the value set by the application.
>
> Fixes: 0adb8eccc6a6 ("vhost: add VDUSE device creation and destruction")
>
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> ---
> lib/vhost/socket.c | 2 +-
> lib/vhost/vduse.c | 4 ++--
> lib/vhost/vduse.h | 6 ++++--
> 3 files changed, 7 insertions(+), 5 deletions(-)
>
lgtm
Acked-by: Kevin Traynor <ktraynor@redhat.com>
@@ -1233,7 +1233,7 @@ rte_vhost_driver_start(const char *path)
return -1;
if (vsocket->is_vduse)
- return vduse_device_create(path);
+ return vduse_device_create(path, vsocket->net_compliant_ol_flags);
if (fdset_tid == 0) {
/**
@@ -412,7 +412,7 @@ vduse_events_handler(int fd, void *arg, int *remove __rte_unused)
}
int
-vduse_device_create(const char *path)
+vduse_device_create(const char *path, bool compliant_ol_flags)
{
int control_fd, dev_fd, vid, ret;
pthread_t fdset_tid;
@@ -538,7 +538,7 @@ vduse_device_create(const char *path)
strncpy(dev->ifname, path, IF_NAME_SZ - 1);
dev->vduse_ctrl_fd = control_fd;
dev->vduse_dev_fd = dev_fd;
- vhost_setup_virtio_net(dev->vid, true, true, true, true);
+ vhost_setup_virtio_net(dev->vid, true, compliant_ol_flags, true, true);
for (i = 0; i < total_queues; i++) {
struct vduse_vq_config vq_cfg = { 0 };
@@ -11,14 +11,16 @@
#ifdef VHOST_HAS_VDUSE
-int vduse_device_create(const char *path);
+int vduse_device_create(const char *path, bool compliant_ol_flags);
int vduse_device_destroy(const char *path);
#else
static inline int
-vduse_device_create(const char *path)
+vduse_device_create(const char *path, bool compliant_ol_flags)
{
+ RTE_SET_USED(compliant_ol_flags);
+
VHOST_LOG_CONFIG(path, ERR, "VDUSE support disabled at build time\n");
return -1;
}