public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] kvm: qemu: Move virtqueue_next_desc() around
@ 2008-10-08 19:35 Mark McLoughlin
  2008-10-08 19:35 ` [PATCH 2/5] kvm: qemu: Introduce virtqueue_fill() and virtqueue_flush() Mark McLoughlin
  0 siblings, 1 reply; 16+ messages in thread
From: Mark McLoughlin @ 2008-10-08 19:35 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm, Rusty Russell, Mark McLoughlin

virtio_next_desc() is only used in virtqueue_pop(), so move
it alongside that.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
---
 qemu/hw/virtio.c |   30 +++++++++++++++---------------
 1 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/qemu/hw/virtio.c b/qemu/hw/virtio.c
index e675f43..b3ee649 100644
--- a/qemu/hw/virtio.c
+++ b/qemu/hw/virtio.c
@@ -107,6 +107,21 @@ static void virtqueue_init(VirtQueue *vq, void *p)
     vq->vring.used = (void *)TARGET_PAGE_ALIGN((unsigned long)&vq->vring.avail->ring[vq->vring.num]);
 }
 
+void virtqueue_push(VirtQueue *vq, const VirtQueueElement *elem,
+		    unsigned int len)
+{
+    VRingUsedElem *used;
+
+    /* Get a pointer to the next entry in the used ring. */
+    used = &vq->vring.used->ring[vq->vring.used->idx % vq->vring.num];
+    used->id = elem->index;
+    used->len = len;
+    /* Make sure buffer is written before we update index. */
+    wmb();
+    vq->vring.used->idx++;
+    vq->inuse--;
+}
+
 static unsigned virtqueue_next_desc(VirtQueue *vq, unsigned int i)
 {
     unsigned int next;
@@ -126,21 +141,6 @@ static unsigned virtqueue_next_desc(VirtQueue *vq, unsigned int i)
     return next;
 }
 
-void virtqueue_push(VirtQueue *vq, const VirtQueueElement *elem,
-		    unsigned int len)
-{
-    VRingUsedElem *used;
-
-    /* Get a pointer to the next entry in the used ring. */
-    used = &vq->vring.used->ring[vq->vring.used->idx % vq->vring.num];
-    used->id = elem->index;
-    used->len = len;
-    /* Make sure buffer is written before we update index. */
-    wmb();
-    vq->vring.used->idx++;
-    vq->inuse--;
-}
-
 int virtqueue_pop(VirtQueue *vq, VirtQueueElement *elem)
 {
     unsigned int i, head;
-- 
1.5.4.3


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2008-11-27 13:33 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-08 19:35 [PATCH 1/5] kvm: qemu: Move virtqueue_next_desc() around Mark McLoughlin
2008-10-08 19:35 ` [PATCH 2/5] kvm: qemu: Introduce virtqueue_fill() and virtqueue_flush() Mark McLoughlin
2008-10-08 19:35   ` [PATCH 3/5] kvm: qemu: Simplify virtio_net_can_receive() a little Mark McLoughlin
2008-10-08 19:35     ` [PATCH 4/5] kvm: qemu: Split iov_fill() out from virtio_net_receive() Mark McLoughlin
2008-10-08 19:35       ` [PATCH 5/5] kvm: qemu: Improve virtio_net recv buffer allocation scheme Mark McLoughlin
2008-10-12 10:00         ` Avi Kivity
2008-10-14 13:44           ` Mark McLoughlin
2008-10-14 15:47             ` Avi Kivity
2008-11-26 14:50             ` [PATCH 0/5] kvm: qemu: virtio_net: add support for mergeable rx buffers Mark McLoughlin
2008-11-26 14:50               ` [PATCH 1/5] kvm: qemu: virtio: move virtqueue_next_desc() around Mark McLoughlin
2008-11-26 14:50                 ` [PATCH 2/5] kvm: qemu: virtio: introduce virtqueue_fill() and virtqueue_flush() Mark McLoughlin
2008-11-26 14:50                   ` [PATCH 3/5] kvm: qemu: virtio: split some helpers out of virtqueue_pop() Mark McLoughlin
2008-11-26 14:50                     ` [PATCH 4/5] kvm: qemu: virtio-net: split iov_fill() out from virtio_net_receive() Mark McLoughlin
2008-11-26 14:50                       ` [PATCH 5/5] kvm: qemu: virtio-net: add a new virtio-net receive buffer scheme Mark McLoughlin
2008-11-27 12:45               ` [PATCH 0/5] kvm: qemu: virtio_net: add support for mergeable rx buffers Avi Kivity
2008-11-27 13:32                 ` Mark McLoughlin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox