summaryrefslogtreecommitdiff
path: root/drivers/vhost/vhost.h
diff options
context:
space:
mode:
authorShannon Nelson <shannon.nelson@amd.com>2023-04-24 15:50:30 -0700
committerMichael S. Tsirkin <mst@redhat.com>2023-06-09 12:07:52 -0400
commit55d8122f5cd62d5aaa225d7167dcd14a44c850b9 (patch)
treeb232ca51d26c34b343ffabbfa80f357b497af5cc /drivers/vhost/vhost.h
parent4b13cbef797048fbb525f8c635a5279e9d209d93 (diff)
vhost: support PACKED when setting-getting vring_base
Use the right structs for PACKED or split vqs when setting and getting the vring base. Fixes: 4c8cf31885f6 ("vhost: introduce vDPA-based backend") Signed-off-by: Shannon Nelson <shannon.nelson@amd.com> Message-Id: <20230424225031.18947-3-shannon.nelson@amd.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'drivers/vhost/vhost.h')
-rw-r--r--drivers/vhost/vhost.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h
index 305ec8593d46..fc900be504b3 100644
--- a/drivers/vhost/vhost.h
+++ b/drivers/vhost/vhost.h
@@ -92,13 +92,17 @@ struct vhost_virtqueue {
/* The routine to call when the Guest pings us, or timeout. */
vhost_work_fn_t handle_kick;
- /* Last available index we saw. */
+ /* Last available index we saw.
+ * Values are limited to 0x7fff, and the high bit is used as
+ * a wrap counter when using VIRTIO_F_RING_PACKED. */
u16 last_avail_idx;
/* Caches available index value from user. */
u16 avail_idx;
- /* Last index we used. */
+ /* Last index we used.
+ * Values are limited to 0x7fff, and the high bit is used as
+ * a wrap counter when using VIRTIO_F_RING_PACKED. */
u16 last_used_idx;
/* Used flags */