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