Skip to content

Commit

Permalink
vhost-user.rst: add clarifying language about protocol negotiation
Browse files Browse the repository at this point in the history
Make the language about feature negotiation explicitly clear about the
handling of the VHOST_USER_F_PROTOCOL_FEATURES feature bit. Try and
avoid the sort of bug introduced in vhost.rs REPLY_ACK processing:

  rust-vmm/vhost#24

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Cc: Jiang Liu <gerry@linux.alibaba.com>
Message-Id: <20210226111619.21178-1-alex.bennee@linaro.org>

Message-Id: <20220321153037.3622127-8-alex.bennee@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
  • Loading branch information
stsquad authored and mstsirkin committed May 16, 2022
1 parent bd59f2a commit fa99726
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions docs/interop/vhost-user.rst
Expand Up @@ -332,6 +332,18 @@ bit was dedicated for this purpose::

#define VHOST_USER_F_PROTOCOL_FEATURES 30

Note that VHOST_USER_F_PROTOCOL_FEATURES is the UNUSED (30) feature
bit defined in `VIRTIO 1.1 6.3 Legacy Interface: Reserved Feature Bits
<https://docs.oasis-open.org/virtio/virtio/v1.1/cs01/virtio-v1.1-cs01.html#x1-4130003>`_.
VIRTIO devices do not advertise this feature bit and therefore VIRTIO
drivers cannot negotiate it.

This reserved feature bit was reused by the vhost-user protocol to add
vhost-user protocol feature negotiation in a backwards compatible
fashion. Old vhost-user master and slave implementations continue to
work even though they are not aware of vhost-user protocol feature
negotiation.

Ring states
-----------

Expand Down Expand Up @@ -890,7 +902,8 @@ Front-end message types
Get the protocol feature bitmask from the underlying vhost
implementation. Only legal if feature bit
``VHOST_USER_F_PROTOCOL_FEATURES`` is present in
``VHOST_USER_GET_FEATURES``.
``VHOST_USER_GET_FEATURES``. It does not need to be acknowledged by
``VHOST_USER_SET_FEATURES``.

.. Note::
Back-ends that report ``VHOST_USER_F_PROTOCOL_FEATURES`` must
Expand All @@ -906,7 +919,8 @@ Front-end message types
Enable protocol features in the underlying vhost implementation.

Only legal if feature bit ``VHOST_USER_F_PROTOCOL_FEATURES`` is present in
``VHOST_USER_GET_FEATURES``.
``VHOST_USER_GET_FEATURES``. It does not need to be acknowledged by
``VHOST_USER_SET_FEATURES``.

.. Note::
Back-ends that report ``VHOST_USER_F_PROTOCOL_FEATURES`` must support
Expand Down

0 comments on commit fa99726

Please sign in to comment.