[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 01/25] virtio: basic structure for packed ring
From: |
Michael S. Tsirkin |
Subject: |
[PULL 01/25] virtio: basic structure for packed ring |
Date: |
Sat, 26 Oct 2019 15:39:10 -0400 |
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>
Signed-off-by: Eugenio PĂ©rez <address@hidden>
Reviewed-by: Jens Freimann <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <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;
--
MST
- [PULL 00/25] virtio: features, tests, Michael S. Tsirkin, 2019/10/26
- [PULL 01/25] virtio: basic structure for packed ring,
Michael S. Tsirkin <=
- [PULL 02/25] virtio: device/driver area size calculation refactor for split ring, Michael S. Tsirkin, 2019/10/26
- [PULL 03/25] virtio: Free blk virqueues at unrealize(), Michael S. Tsirkin, 2019/10/26
- [PULL 04/25] virtio: Free rnd virqueue at unrealize(), Michael S. Tsirkin, 2019/10/26
- [PULL 05/25] virtio: basic packed virtqueue support, Michael S. Tsirkin, 2019/10/26
- [PULL 06/25] virtio: event suppression support for packed ring, Michael S. Tsirkin, 2019/10/26
- [PULL 07/25] vhost_net: enable packed ring support, Michael S. Tsirkin, 2019/10/26
- [PULL 08/25] virtio: add property to enable packed virtqueue, Michael S. Tsirkin, 2019/10/26
- [PULL 09/25] tests/virtio-blk-test: read config space after feature negotiation, Michael S. Tsirkin, 2019/10/26
- [PULL 10/25] libqos: read QVIRTIO_MMIO_VERSION register, Michael S. Tsirkin, 2019/10/26
- [PULL 11/25] libqos: extend feature bits to 64-bit, Michael S. Tsirkin, 2019/10/26