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 265ACA09FD; Fri, 18 Dec 2020 14:24:02 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3B7D3CAD6; Fri, 18 Dec 2020 14:23:59 +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 0F8A0CAC0; Fri, 18 Dec 2020 14:23:57 +0100 (CET) Received: from glumotte.dev.6wind.com. (unknown [10.16.0.195]) by proxy.6wind.com (Postfix) with ESMTP id CBB9F4AC370; Fri, 18 Dec 2020 14:23:55 +0100 (CET) From: Olivier Matz To: dev@dpdk.org Cc: Maxime Coquelin , Chenbo Xia , stable@dpdk.org Date: Fri, 18 Dec 2020 14:23:52 +0100 Message-Id: <20201218132352.15834-1-olivier.matz@6wind.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201218125217.12963-1-olivier.matz@6wind.com> References: <20201218125217.12963-1-olivier.matz@6wind.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2] 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 --- v2 * fix obvious fallthrough case, sorry for the noise drivers/net/virtio/virtio_user/vhost_user.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/virtio/virtio_user/vhost_user.c b/drivers/net/virtio/virtio_user/vhost_user.c index b93e65c60b..350eed4182 100644 --- a/drivers/net/virtio/virtio_user/vhost_user.c +++ b/drivers/net/virtio/virtio_user/vhost_user.c @@ -297,13 +297,18 @@ vhost_user_sock(struct virtio_user_dev *dev, if (has_reply_ack) msg.flags |= VHOST_USER_NEED_REPLY_MASK; /* Fallthrough */ - case VHOST_USER_SET_FEATURES: case VHOST_USER_SET_PROTOCOL_FEATURES: case VHOST_USER_SET_LOG_BASE: msg.payload.u64 = *((__u64 *)arg); msg.size = sizeof(m.payload.u64); break; + 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_OWNER: case VHOST_USER_RESET_OWNER: break; -- 2.25.1