virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][RESEND] Relax BUG_ON()s when enabling/disabling virt_ring interrupts
@ 2008-01-06  2:43 Anthony Liguori
  2008-01-07  3:27 ` Rusty Russell
  0 siblings, 1 reply; 3+ messages in thread
From: Anthony Liguori @ 2008-01-06  2:43 UTC (permalink / raw)
  To: virtualization; +Cc: Anthony Liguori

Currently, the virt_ring->enable_cb and virt_ring->disable_cb functions enforce
that they were called only when callbacks were disabled and enabled
respectively.  However, in the current vring implementation, this isn't
actually a bug.  What's more, the virtio_net driver does not guard against
double enabling or double disabling.  All that needs to happen is for an rx
notification to happen twice beforce the virtnet_poll function is invoked to
trigger the BUG_ON.

This patch removes the BUG_ON()s since there are no negative side effects in
the current vring code.  In the future, if a ring implementation cannot support
double enabling or double disabling, it is far easier for them to handle this
by maintaining an enabled flag than forcing every virtio driver to maintain
this sort of state.

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

diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index 15ee2fa..9599236 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -227,7 +227,6 @@ static void vring_disable_cb(struct virtqueue *_vq)
 	struct vring_virtqueue *vq = to_vvq(_vq);
 
 	START_USE(vq);
-	BUG_ON(vq->vring.avail->flags & VRING_AVAIL_F_NO_INTERRUPT);
 	vq->vring.avail->flags |= VRING_AVAIL_F_NO_INTERRUPT;
 	END_USE(vq);
 }
@@ -237,7 +236,6 @@ static bool vring_enable_cb(struct virtqueue *_vq)
 	struct vring_virtqueue *vq = to_vvq(_vq);
 
 	START_USE(vq);
-	BUG_ON(!(vq->vring.avail->flags & VRING_AVAIL_F_NO_INTERRUPT));
 
 	/* We optimistically turn back on interrupts, then check if there was
 	 * more to do. */

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

end of thread, other threads:[~2008-01-07  4:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-06  2:43 [PATCH][RESEND] Relax BUG_ON()s when enabling/disabling virt_ring interrupts Anthony Liguori
2008-01-07  3:27 ` Rusty Russell
2008-01-07  4:29   ` 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).