virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Always notify a virtio_ring when it's full
@ 2008-01-08 20:54 Anthony Liguori
  2008-01-09  0:34 ` Rusty Russell
  0 siblings, 1 reply; 2+ messages in thread
From: Anthony Liguori @ 2008-01-08 20:54 UTC (permalink / raw)
  To: virtualization; +Cc: Anthony Liguori

I saw that the tx timer was removed in your patch queue but you weren't
notifying when full.  I decided to do it here instead of in the error case on
add_buf for really no great reason other than I thought it made more sense
for it to happen in the notify().

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index 7fa1c72..57b7ad3 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -146,7 +146,8 @@ static void vring_kick(struct virtqueue *_vq)
 	/* Need to update avail index before checking if we should notify */
 	mb();
 
-	if (!(vq->vring.used->flags & VRING_USED_F_NO_NOTIFY))
+	/* Always notify when the queue is full */
+	if (!(vq->vring.used->flags & VRING_USED_F_NO_NOTIFY) || !vq->num_free)
 		/* Prod other side to tell it about changes. */
 		vq->notify(&vq->vq);

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

end of thread, other threads:[~2008-01-09  0:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-08 20:54 [PATCH] Always notify a virtio_ring when it's full Anthony Liguori
2008-01-09  0:34 ` Rusty Russell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).