Blame SOURCES/0006-vhost-drop-virtqueues-only-with-built-in-virtio-driv.patch

a6040a
From c18b2f65e0a3be55e30fc3df6062e00353dfdb26 Mon Sep 17 00:00:00 2001
a6040a
From: Stefan Hajnoczi <stefanha@redhat.com>
a6040a
Date: Wed, 31 Jan 2018 17:46:51 +0000
a6040a
Subject: [PATCH 6/6] vhost: drop virtqueues only with built-in virtio driver
a6040a
a6040a
Commit e29109323595beb3884da58126ebb3b878cb66f5 ("vhost: destroy unused
a6040a
virtqueues when multiqueue not negotiated") broke vhost-scsi by removing
a6040a
virtqueues when the virtio-net-specific VIRTIO_NET_F_MQ feature bit is
a6040a
missing.
a6040a
a6040a
The vhost_user.c code shouldn't assume all devices are vhost net device
a6040a
backends.  Use the new VIRTIO_DEV_BUILTIN_VIRTIO_NET flag to check
a6040a
whether virtio_net.c is being used.
a6040a
a6040a
This fixes examples/vhost_scsi.
a6040a
a6040a
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
a6040a
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
a6040a
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
a6040a
(cherry picked from commit 33adfbc805651f455dbf19f1e4b4b0878717a5e5)
a6040a
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
a6040a
---
a6040a
 dpdk-17.11/lib/librte_vhost/vhost_user.c | 3 ++-
a6040a
 1 file changed, 2 insertions(+), 1 deletion(-)
a6040a
a6040a
diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
a6040a
index 1848c8de9..f334497d4 100644
a6040a
--- a/lib/librte_vhost/vhost_user.c
a6040a
+++ b/lib/librte_vhost/vhost_user.c
a6040a
@@ -216,7 +216,8 @@ vhost_user_set_features(struct virtio_net *dev, uint64_t features)
a6040a
 		(dev->features & (1 << VIRTIO_NET_F_MRG_RXBUF)) ? "on" : "off",
a6040a
 		(dev->features & (1ULL << VIRTIO_F_VERSION_1)) ? "on" : "off");
a6040a
 
a6040a
-	if (!(dev->features & (1ULL << VIRTIO_NET_F_MQ))) {
a6040a
+	if ((dev->flags & VIRTIO_DEV_BUILTIN_VIRTIO_NET) &&
a6040a
+	    !(dev->features & (1ULL << VIRTIO_NET_F_MQ))) {
a6040a
 		/*
a6040a
 		 * Remove all but first queue pair if MQ hasn't been
a6040a
 		 * negotiated. This is safe because the device is not
a6040a
-- 
a6040a
2.14.3
a6040a