From: Maxime Coquelin <[email protected]>

Enable the VIRTIO_NET_F_STATUS feature for VDUSE devices.
This allows the device to report link status (e.g.,
VIRTIO_NET_S_LINK_UP). It also allows the device to signal the driver
that it needs to send gratuitous ARP with VIRTIO_NET_S_ANNOUNCE.

Signed-off-by: Maxime Coquelin <[email protected]>
Signed-off-by: Eugenio Pérez <[email protected]>
---
v2:
* Move the start and last declarations in the braces as gcc 8 does not
  like them interleaved with statements. Actually, I think the move was
  a mistake in the first version.
  https://mails.dpdk.org/archives/test-report/2026-February/958175.html
---
 lib/vhost/vduse.c | 1 +
 lib/vhost/vduse.h | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/vhost/vduse.c b/lib/vhost/vduse.c
index 80020d3d5413..54fe6cf35bc6 100644
--- a/lib/vhost/vduse.c
+++ b/lib/vhost/vduse.c
@@ -801,6 +801,7 @@ vduse_device_create(const char *path, bool 
compliant_ol_flags, bool extbuf, bool
                        goto out_ctrl_close;
                }
 
+               vnet_config.status = VIRTIO_NET_S_LINK_UP;
                vnet_config.max_virtqueue_pairs = max_queue_pairs;
                memset(dev_config, 0, sizeof(struct vduse_dev_config));
 
diff --git a/lib/vhost/vduse.h b/lib/vhost/vduse.h
index b2515bb9df76..d697f85be5cc 100644
--- a/lib/vhost/vduse.h
+++ b/lib/vhost/vduse.h
@@ -7,7 +7,8 @@
 
 #include "vhost.h"
 
-#define VDUSE_NET_SUPPORTED_FEATURES VIRTIO_NET_SUPPORTED_FEATURES
+#define VDUSE_NET_SUPPORTED_FEATURES (VIRTIO_NET_SUPPORTED_FEATURES | \
+               (1ULL << VIRTIO_NET_F_STATUS))
 
 int vduse_device_create(const char *path, bool compliant_ol_flags, bool 
extbuf, bool linearbuf);
 int vduse_device_destroy(const char *path);
-- 
2.53.0

Reply via email to