From d851d28d2b8047772ddd2937787bb57c8fec0721 Mon Sep 17 00:00:00 2001 From: Olivier Matz Date: Thu, 17 Dec 2020 17:24:57 +0100 Subject: [PATCH] net/virtio-user: fix advertising of protocol features When connected to a vhost-user backend, the flag VHOST_USER_F_PROTOCOL_FEATURES is not advertised, preventing to do multiqueue (the VHOST_USER_PROTOCOL_F_MQ protocol feature is ignored by some backends if the VHOST_USER_F_PROTOCOL_FEATURES feature is not set). When setting vhost-user features, always advertise this flag. Fixes: 8e7561054ac7 ("net/virtio: support vhost-user protocol features") Suggested-by: Maxime Coquelin Signed-off-by: Olivier Matz --- drivers/net/virtio/virtio_user/vhost_user.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/virtio/virtio_user/vhost_user.c b/drivers/net/virtio/virtio_user/vhost_user.c index b93e65c60b..706266a216 100644 --- a/drivers/net/virtio/virtio_user/vhost_user.c +++ b/drivers/net/virtio/virtio_user/vhost_user.c @@ -298,6 +298,10 @@ vhost_user_sock(struct virtio_user_dev *dev, msg.flags |= VHOST_USER_NEED_REPLY_MASK; /* Fallthrough */ case VHOST_USER_SET_FEATURES: + msg.payload.u64 = *((__u64 *)arg) | + 1ULL << VHOST_USER_F_PROTOCOL_FEATURES; + msg.size = sizeof(m.payload.u64); + break; case VHOST_USER_SET_PROTOCOL_FEATURES: case VHOST_USER_SET_LOG_BASE: msg.payload.u64 = *((__u64 *)arg); -- 2.20.1