summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJason Wang <jasowang@redhat.com>2021-06-02 04:15:33 +0200
committerMichael S. Tsirkin <mst@redhat.com>2021-07-08 13:49:01 +0200
commit530a5678bc0083e84f99f38f77ced8fbb3d18434 (patch)
treeefe36d8359d486f9b03c9f3a093120e5b2f1c752 /include
parentvirtio-ring: store DMA metadata in desc_extra for split virtqueue (diff)
downloadlinux-530a5678bc0083e84f99f38f77ced8fbb3d18434.tar.xz
linux-530a5678bc0083e84f99f38f77ced8fbb3d18434.zip
vdpa: support packed virtqueue for set/get_vq_state()
This patch extends the vdpa_vq_state to support packed virtqueue state which is basically the device/driver ring wrap counters and the avail and used index. This will be used for the virito-vdpa support for the packed virtqueue and the future vhost/vhost-vdpa support for the packed virtqueue. Signed-off-by: Jason Wang <jasowang@redhat.com> Link: https://lore.kernel.org/r/20210602021536.39525-2-jasowang@redhat.com Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Eli Cohen <elic@nvidia.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/vdpa.h25
1 files changed, 23 insertions, 2 deletions
diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h
index f311d227aa1b..3357ac98878d 100644
--- a/include/linux/vdpa.h
+++ b/include/linux/vdpa.h
@@ -28,13 +28,34 @@ struct vdpa_notification_area {
};
/**
- * struct vdpa_vq_state - vDPA vq_state definition
+ * struct vdpa_vq_state_split - vDPA split virtqueue state
* @avail_index: available index
*/
-struct vdpa_vq_state {
+struct vdpa_vq_state_split {
u16 avail_index;
};
+/**
+ * struct vdpa_vq_state_packed - vDPA packed virtqueue state
+ * @last_avail_counter: last driver ring wrap counter observed by device
+ * @last_avail_idx: device available index
+ * @last_used_counter: device ring wrap counter
+ * @last_used_idx: used index
+ */
+struct vdpa_vq_state_packed {
+ u16 last_avail_counter:1;
+ u16 last_avail_idx:15;
+ u16 last_used_counter:1;
+ u16 last_used_idx:15;
+};
+
+struct vdpa_vq_state {
+ union {
+ struct vdpa_vq_state_split split;
+ struct vdpa_vq_state_packed packed;
+ };
+};
+
struct vdpa_mgmt_dev;
/**