From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 58A3D1B801 for ; Wed, 31 Jan 2018 18:48:41 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B754433BC7; Wed, 31 Jan 2018 17:48:40 +0000 (UTC) Received: from localhost (ovpn-116-113.ams2.redhat.com [10.36.116.113]) by smtp.corp.redhat.com (Postfix) with ESMTP id 11DC960629; Wed, 31 Jan 2018 17:48:38 +0000 (UTC) From: Stefan Hajnoczi To: dev@dpdk.org Cc: Maxime Coquelin , Yuanhan Liu , Stefan Hajnoczi Date: Wed, 31 Jan 2018 17:46:51 +0000 Message-Id: <20180131174651.6386-3-stefanha@redhat.com> In-Reply-To: <20180131174651.6386-1-stefanha@redhat.com> References: <20180131174651.6386-1-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 31 Jan 2018 17:48:40 +0000 (UTC) Subject: [dpdk-dev] [PATCH 2/2] vhost: only drop vqs with built-in virtio_net.c driver 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: , X-List-Received-Date: Wed, 31 Jan 2018 17:48:41 -0000 Commit e29109323595beb3884da58126ebb3b878cb66f5 ("vhost: destroy unused virtqueues when multiqueue not negotiated") broke vhost-scsi by removing virtqueues when the virtio-net-specific VIRTIO_NET_F_MQ feature bit is missing. The vhost_user.c code shouldn't assume all devices are vhost net device backends. Use the new VIRTIO_DEV_BUILTIN_VIRTIO_NET flag to check whether virtio_net.c is being used. This fixes examples/vhost_scsi. Cc: Maxime Coquelin Signed-off-by: Stefan Hajnoczi --- lib/librte_vhost/vhost_user.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c index 1dd1a61b6..65ee33919 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -187,7 +187,8 @@ vhost_user_set_features(struct virtio_net *dev, uint64_t features) (dev->features & (1 << VIRTIO_NET_F_MRG_RXBUF)) ? "on" : "off", (dev->features & (1ULL << VIRTIO_F_VERSION_1)) ? "on" : "off"); - if (!(dev->features & (1ULL << VIRTIO_NET_F_MQ))) { + if ((dev->flags & VIRTIO_DEV_BUILTIN_VIRTIO_NET) && + !(dev->features & (1ULL << VIRTIO_NET_F_MQ))) { /* * Remove all but first queue pair if MQ hasn't been * negotiated. This is safe because the device is not -- 2.14.3