All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Eugenio Pérez" <eperezma@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Kevin Wolf" <kwolf@redhat.com>,
	"Laurent Vivier" <lvivier@redhat.com>,
	qemu-block@nongnu.org, "Amit Shah" <amit@kernel.org>,
	"Jason Wang" <jasowang@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Max Reitz" <mreitz@redhat.com>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Fam Zheng" <fam@euphon.net>,
	"Jens Freimann" <jfreimann@redhat.com>
Subject: [PATCH v7 1/8] virtio: basic structure for packed ring
Date: Fri, 25 Oct 2019 10:35:20 +0200	[thread overview]
Message-ID: <20191025083527.30803-2-eperezma@redhat.com> (raw)
In-Reply-To: <20191025083527.30803-1-eperezma@redhat.com>

From: Wei Xu <wexu@redhat.com>

Define packed ring structure according to Qemu nomenclature,
field data(wrap counter, etc) are also included.

Signed-off-by: Wei Xu <wexu@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
---
 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



  reply	other threads:[~2019-10-25  8:38 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-25  8:35 [PATCH v7 0/8] Packed virtqueue for virtio Eugenio Pérez
2019-10-25  8:35 ` Eugenio Pérez [this message]
2019-10-25  8:35 ` [PATCH v7 2/8] virtio: device/driver area size calculation refactor for split ring Eugenio Pérez
2019-10-25  8:35 ` [PATCH v7 3/8] virtio: Free blk virqueues at unrealize() Eugenio Pérez
2019-10-25  8:35 ` [PATCH v7 4/8] virtio: Free rnd virqueue " Eugenio Pérez
2019-10-25  8:35 ` [PATCH v7 5/8] virtio: basic packed virtqueue support Eugenio Pérez
2019-10-25  8:35 ` [PATCH v7 6/8] virtio: event suppression support for packed ring Eugenio Pérez
2019-10-25  8:35 ` [PATCH v7 7/8] vhost_net: enable packed ring support Eugenio Pérez
2019-10-25  8:35 ` [PATCH v7 8/8] virtio: add property to enable packed virtqueue Eugenio Pérez
2019-10-25 11:34 ` [PATCH v7 0/8] Packed virtqueue for virtio Michael S. Tsirkin
2019-10-27  8:40   ` Stefan Hajnoczi
2019-10-28  8:04   ` Eugenio Perez Martin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191025083527.30803-2-eperezma@redhat.com \
    --to=eperezma@redhat.com \
    --cc=amit@kernel.org \
    --cc=fam@euphon.net \
    --cc=jasowang@redhat.com \
    --cc=jfreimann@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.