[PATCH][RESEND] Relax BUG_ON()s when enabling/disabling virt_ring interrupts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>

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. */
_______________________________________________
Virtualization mailing list
Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/virtualization

[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux