From: Olivier Matz <olivier.matz@6wind.com>
To: dev@dpdk.org
Cc: Maxime Coquelin <maxime.coquelin@redhat.com>,
Chenbo Xia <chenbo.xia@intel.com>,
stable@dpdk.org
Subject: [dpdk-dev] [PATCH] net/virtio-user: fix advertising of protocol features
Date: Fri, 18 Dec 2020 13:52:17 +0100 [thread overview]
Message-ID: <20201218125217.12963-1-olivier.matz@6wind.com> (raw)
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 <maxime.coquelin@redhat.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
---
drivers/net/virtio/virtio_user/vhost_user.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/virtio/virtio_user/vhost_user.c b/drivers/net/virtio/virtio_user/vhost_user.c
index b93e65c60b..5e8a5c293e 100644
--- a/drivers/net/virtio/virtio_user/vhost_user.c
+++ b/drivers/net/virtio/virtio_user/vhost_user.c
@@ -298,6 +298,10 @@ vhost_user_sock(struct virtio_user_dev *dev,
msg.flags |= VHOST_USER_NEED_REPLY_MASK;
/* Fallthrough */
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_PROTOCOL_FEATURES:
case VHOST_USER_SET_LOG_BASE:
msg.payload.u64 = *((__u64 *)arg);
--
2.25.1
next reply other threads:[~2020-12-18 12:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-18 12:52 Olivier Matz [this message]
2020-12-18 13:23 ` [dpdk-dev] [PATCH v2] " Olivier Matz
2020-12-22 10:48 ` Maxime Coquelin
2021-01-08 9:15 ` Maxime Coquelin
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=20201218125217.12963-1-olivier.matz@6wind.com \
--to=olivier.matz@6wind.com \
--cc=chenbo.xia@intel.com \
--cc=dev@dpdk.org \
--cc=maxime.coquelin@redhat.com \
--cc=stable@dpdk.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).