aboutsummaryrefslogtreecommitdiff
path: root/include/hw/virtio/vhost.h
diff options
context:
space:
mode:
authorAlex Bennée <alex.bennee@linaro.org>2022-11-23 15:21:33 +0000
committerMichael S. Tsirkin <mst@redhat.com>2022-12-21 06:35:28 -0500
commit9600c98e12617649a7e09533beb722d2ffc71f44 (patch)
treefede7c1422c7e1dab902978bc221e75158ce59e6 /include/hw/virtio/vhost.h
parentc98ac64cfb53ccb862a80e818c3a19bdd386e61e (diff)
include/hw: attempt to document VirtIO feature variables
We have a bunch of variables associated with the device and the vhost backend which are used inconsistently throughout the code base. Lets start trying to bring some order by agreeing what each variable is for. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Cc: Stefano Garzarella <sgarzare@redhat.com> Cc: "Michael S. Tsirkin" <mst@redhat.com> Cc: Stefan Hajnoczi <stefanha@gmail.com> Message-Id: <20221123152134.179929-2-alex.bennee@linaro.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include/hw/virtio/vhost.h')
-rw-r--r--include/hw/virtio/vhost.h25
1 files changed, 22 insertions, 3 deletions
diff --git a/include/hw/virtio/vhost.h b/include/hw/virtio/vhost.h
index 67a6807fac..1cafa0d776 100644
--- a/include/hw/virtio/vhost.h
+++ b/include/hw/virtio/vhost.h
@@ -88,13 +88,32 @@ struct vhost_dev {
int vq_index_end;
/* if non-zero, minimum required value for max_queues */
int num_queues;
+ /**
+ * vhost feature handling requires matching the feature set
+ * offered by a backend which may be a subset of the total
+ * features eventually offered to the guest.
+ *
+ * @features: available features provided by the backend
+ * @acked_features: final negotiated features with front-end driver
+ *
+ * @backend_features: this is used in a couple of places to either
+ * store VHOST_USER_F_PROTOCOL_FEATURES to apply to
+ * VHOST_USER_SET_FEATURES or VHOST_NET_F_VIRTIO_NET_HDR. Its
+ * future use should be discouraged and the variable retired as
+ * its easy to confuse with the VirtIO backend_features.
+ */
uint64_t features;
- /** @acked_features: final set of negotiated features */
uint64_t acked_features;
- /** @backend_features: backend specific feature bits */
uint64_t backend_features;
- /** @protocol_features: final negotiated protocol features */
+
+ /**
+ * @protocol_features: is the vhost-user only feature set by
+ * VHOST_USER_SET_PROTOCOL_FEATURES. Protocol features are only
+ * negotiated if VHOST_USER_F_PROTOCOL_FEATURES has been offered
+ * by the backend (see @features).
+ */
uint64_t protocol_features;
+
uint64_t max_queues;
uint64_t backend_cap;
/* @started: is the vhost device started? */