From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Kevin Wolf" <kwolf@redhat.com>, "Fam Zheng" <fam@euphon.net>,
"Thomas Huth" <thuth@redhat.com>,
"Eduardo Habkost" <ehabkost@redhat.com>,
qemu-block@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>,
"Laurent Vivier" <lvivier@redhat.com>,
jasowang@redhat.com, cohuck@redhat.com,
"Stefan Hajnoczi" <stefanha@redhat.com>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
"Raphael Norwitz" <raphael.norwitz@nutanix.com>,
"Ben Walker" <benjamin.walker@intel.com>,
"Gonglei (Arei)" <arei.gonglei@huawei.com>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Max Reitz" <mreitz@redhat.com>,
"Sebastien Boeuf" <sebastien.boeuf@intel.com>
Subject: [PATCH v2 3/7] docs: document non-net VHOST_USER_GET_FEATURES behavior
Date: Tue, 9 Jun 2020 18:02:14 +0100 [thread overview]
Message-ID: <20200609170218.246468-4-stefanha@redhat.com> (raw)
In-Reply-To: <20200609170218.246468-1-stefanha@redhat.com>
QEMU enabled several feature bits for non-net devices without allowing
the device backend to control them. This only works when the device
backend implements support for those features. It won't work for new
features like the packed virtqueue layout, where proper feature
negotiation will be needed.
Document the legacy behavior and specify that device backends must
report features so that we can avoid problems in the future.
Cc: Ben Walker <benjamin.walker@intel.com>
Cc: Sebastien Boeuf <sebastien.boeuf@intel.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
CCing SPDK and cloud-hypervisor folks in case they are affected. DPDK
isn't affected since vhost-user-net performs full feature negotiation.
---
docs/interop/vhost-user.rst | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/docs/interop/vhost-user.rst b/docs/interop/vhost-user.rst
index 3b1b6602c7..dfadee411d 100644
--- a/docs/interop/vhost-user.rst
+++ b/docs/interop/vhost-user.rst
@@ -290,6 +290,27 @@ bit was dedicated for this purpose::
#define VHOST_USER_F_PROTOCOL_FEATURES 30
+Feature negotiation
+-------------------
+The master fetches features from the backend using the
+``VHOST_USER_GET_FEATURES`` message. The feature bits correspond to those from
+the virtio specification, VHOST_F_LOG_ALL (26), and
+``VHOST_USER_F_PROTOCOL_FEATURES`` (30).
+
+Backends must report all supported feature bits. If a feature bit is set then
+the master may set it in the ``VHOST_USER_SET_FEATURES`` message. If a feature
+bit is cleared then the master must not set it in the
+``VHOST_USER_SET_FEATURES`` message.
+
+For devices other than the networking device, masters may assume the following
+feature bits are always set in ``VHOST_USER_GET_FEATURES`` for compatibility
+with legacy backend implementations that do not report them correctly:
+* ``VIRTIO_F_RING_INDIRECT_DESC``
+* ``VIRTIO_F_RING_EVENT_IDX``
+* ``VIRTIO_F_VERSION_1``
+* ``VIRTIO_F_NOTIFY_ON_EMPTY``
+* ``VIRTIO_F_ANY_LAYOUT``
+
Starting and stopping rings
---------------------------
--
2.26.2
next prev parent reply other threads:[~2020-06-09 17:24 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-09 17:02 [PATCH v2 0/7] virtio: enable VIRTIO_F_RING_PACKED for all devices Stefan Hajnoczi
2020-06-09 17:02 ` [PATCH v2 1/7] tests/libqos: mask out VIRTIO_F_RING_PACKED for now Stefan Hajnoczi
2020-06-09 17:02 ` [PATCH v2 2/7] libvhost-user: advertise vring features Stefan Hajnoczi
2020-06-09 17:02 ` Stefan Hajnoczi [this message]
2020-06-10 5:01 ` [PATCH v2 3/7] docs: document non-net VHOST_USER_GET_FEATURES behavior Michael S. Tsirkin
2020-07-06 9:26 ` Stefan Hajnoczi
2020-06-09 17:02 ` [PATCH v2 4/7] vhost: involve device backends in feature negotiation Stefan Hajnoczi
2020-06-09 18:07 ` Michael S. Tsirkin
2020-06-10 3:21 ` Jason Wang
2020-06-10 4:15 ` Michael S. Tsirkin
2020-06-10 5:53 ` Jason Wang
2020-06-10 6:11 ` Michael S. Tsirkin
2020-06-10 6:20 ` Jason Wang
2020-07-06 10:23 ` Stefan Hajnoczi
2020-06-10 6:20 ` Michael S. Tsirkin
2020-06-09 17:02 ` [PATCH v2 5/7] vhost-user-blk: add VIRTIO_F_RING_PACKED feature bit Stefan Hajnoczi
2020-06-09 17:02 ` [PATCH v2 6/7] vhost-scsi: add VIRTIO_F_VERSION_1 and VIRTIO_F_RING_PACKED Stefan Hajnoczi
2020-06-09 17:02 ` [PATCH v2 7/7] virtio: enable VIRTIO_F_RING_PACKED for all devices Stefan Hajnoczi
2020-06-10 5:02 ` [PATCH v2 0/7] " Michael S. Tsirkin
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=20200609170218.246468-4-stefanha@redhat.com \
--to=stefanha@redhat.com \
--cc=arei.gonglei@huawei.com \
--cc=benjamin.walker@intel.com \
--cc=cohuck@redhat.com \
--cc=dgilbert@redhat.com \
--cc=ehabkost@redhat.com \
--cc=fam@euphon.net \
--cc=jasowang@redhat.com \
--cc=kraxel@redhat.com \
--cc=kwolf@redhat.com \
--cc=lvivier@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=mreitz@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=raphael.norwitz@nutanix.com \
--cc=sebastien.boeuf@intel.com \
--cc=thuth@redhat.com \
/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).