From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0E5F7A09FD; Fri, 18 Dec 2020 13:52:29 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4F3F1CAB6; Fri, 18 Dec 2020 13:52:27 +0100 (CET) Received: from proxy.6wind.com (host.76.145.23.62.rev.coltfrance.com [62.23.145.76]) by dpdk.org (Postfix) with ESMTP id 01D46CAAF; Fri, 18 Dec 2020 13:52:24 +0100 (CET) Received: from glumotte.dev.6wind.com. (unknown [10.16.0.195]) by proxy.6wind.com (Postfix) with ESMTP id 7B1014AC304; Fri, 18 Dec 2020 13:52:23 +0100 (CET) From: Olivier Matz To: dev@dpdk.org Cc: Maxime Coquelin , Chenbo Xia , stable@dpdk.org Date: Fri, 18 Dec 2020 13:52:17 +0100 Message-Id: <20201218125217.12963-1-olivier.matz@6wind.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] net/virtio-user: fix advertising of protocol features X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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, advertise this flag if it was advertised by our peer. Fixes: 8e7561054ac7 ("net/virtio: support vhost-user protocol features") Cc: stable@dpdk.org 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..5e8a5c293e 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) | (dev->device_features & + (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.25.1