[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 1/9] virtio: basic structure for packed ring
From: |
Eugenio Pérez |
Subject: |
[PATCH v6 1/9] virtio: basic structure for packed ring |
Date: |
Thu, 24 Oct 2019 19:13:58 +0200 |
From: Wei Xu <address@hidden>
Define packed ring structure according to Qemu nomenclature,
field data(wrap counter, etc) are also included.
Signed-off-by: Wei Xu <address@hidden>
Signed-off-by: Jason Wang <address@hidden>
Reviewed-by: Jens Freimann <address@hidden>
---
hw/virtio/virtio.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 527df03bfd..fdac203cdf 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -43,6 +43,13 @@ typedef struct VRingDesc
uint16_t next;
} VRingDesc;
+typedef struct VRingPackedDesc {
+ uint64_t addr;
+ uint32_t len;
+ uint16_t id;
+ uint16_t flags;
+} VRingPackedDesc;
+
typedef struct VRingAvail
{
uint16_t flags;
@@ -81,17 +88,25 @@ typedef struct VRing
VRingMemoryRegionCaches *caches;
} VRing;
+typedef struct VRingPackedDescEvent {
+ uint16_t off_wrap;
+ uint16_t flags;
+} VRingPackedDescEvent ;
+
struct VirtQueue
{
VRing vring;
/* Next head to pop */
uint16_t last_avail_idx;
+ bool last_avail_wrap_counter;
/* Last avail_idx read from VQ. */
uint16_t shadow_avail_idx;
+ bool shadow_avail_wrap_counter;
uint16_t used_idx;
+ bool used_wrap_counter;
/* Last used index value we have signalled on */
uint16_t signalled_used;
--
2.16.5
- [PATCH v6 0/9] Packed virtqueue for virtio, Eugenio Pérez, 2019/10/24
- [PATCH v6 1/9] virtio: basic structure for packed ring,
Eugenio Pérez <=
- [PATCH v6 2/9] virtio: device/driver area size calculation refactor for split ring, Eugenio Pérez, 2019/10/24
- [PATCH v6 3/9] virtio: Free rng and blk virqueues, Eugenio Pérez, 2019/10/24
- [PATCH v6 5/9] virtio: event suppression support for packed ring, Eugenio Pérez, 2019/10/24
- [PATCH v6 6/9] vhost_net: enable packed ring support, Eugenio Pérez, 2019/10/24
- [PATCH v6 4/9] virtio: basic packed virtqueue support, Eugenio Pérez, 2019/10/24
- [PATCH v6 7/9] virtio: add property to enable packed virtqueue, Eugenio Pérez, 2019/10/24
- [PATCH v6 8/9] virtio: add some rcu comments, Eugenio Pérez, 2019/10/24
- [PATCH v6 9/9] virtio: Move vdev->broken check to dispatch drop_all, Eugenio Pérez, 2019/10/24
- Re: [PATCH v6 0/9] Packed virtqueue for virtio, Jason Wang, 2019/10/24