From: Stefan Hajnoczi <stefanha@redhat.com>
To: dev@dpdk.org
Cc: Maxime Coquelin <maxime.coquelin@redhat.com>,
Yuanhan Liu <yliu@fridaylinux.org>,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: [dpdk-dev] [PATCH 2/2] vhost: only drop vqs with built-in virtio_net.c driver
Date: Wed, 31 Jan 2018 17:46:51 +0000 [thread overview]
Message-ID: <20180131174651.6386-3-stefanha@redhat.com> (raw)
In-Reply-To: <20180131174651.6386-1-stefanha@redhat.com>
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 <maxime.coquelin@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
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
next prev parent reply other threads:[~2018-01-31 17:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-31 17:46 [dpdk-dev] [PATCH 0/2] vhost: fix VIRTIO_NET_F_MQ vhost_scsi breakage Stefan Hajnoczi
2018-01-31 17:46 ` [dpdk-dev] [PATCH 1/2] vhost: add flag for built-in virtio_net.c driver Stefan Hajnoczi
2018-02-01 14:46 ` Yuanhan Liu
2018-01-31 17:46 ` Stefan Hajnoczi [this message]
2018-01-31 18:07 ` [dpdk-dev] [PATCH 2/2] vhost: only drop vqs with " Maxime Coquelin
[not found] ` <20180201102428.GA5783@stefanha-x1.localdomain>
2018-02-01 12:49 ` Maxime Coquelin
2018-02-01 12:58 ` [dpdk-dev] [PATCH 0/2] vhost: fix VIRTIO_NET_F_MQ vhost_scsi breakage Maxime Coquelin
2018-02-05 14:20 ` Ferruh Yigit
2018-02-01 14:46 ` Yuanhan Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180131174651.6386-3-stefanha@redhat.com \
--to=stefanha@redhat.com \
--cc=dev@dpdk.org \
--cc=maxime.coquelin@redhat.com \
--cc=yliu@fridaylinux.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).