aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/virtio/virtio_ring.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2008-05-30 16:09:45 -0400
committerRusty Russell <rusty@rustcorp.com.au>2008-05-30 01:09:46 -0400
commitb4f68be6c5d507afdcd74f5be3df0b1209cda503 (patch)
tree85c0771058ff08c5dab5eedbf3395959dbafc878 /drivers/virtio/virtio_ring.c
parent7757f09c70af87887dfc195e6d6ddd54f5cc7c39 (diff)
virtio: force callback on empty.
virtio allows drivers to suppress callbacks (ie. interrupts) for efficiency (no locking, it's just an optimization). There's a similar mechanism for the host to suppress notifications coming from the guest: in that case, we ignore the suppression if the ring is completely full. It turns out that life is simpler if the host similarly ignores callback suppression when the ring is completely empty: the network driver wants to free up old packets in a timely manner, and otherwise has to use a timer to poll. We have to remove the code which ignores interrupts when the driver has disabled them (again, it had no locking and hence was unreliable anyway). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'drivers/virtio/virtio_ring.c')
-rw-r--r--drivers/virtio/virtio_ring.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index 96d2567a7df8..72bf8bc09014 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -253,13 +253,6 @@ irqreturn_t vring_interrupt(int irq, void *_vq)
253 if (unlikely(vq->broken)) 253 if (unlikely(vq->broken))
254 return IRQ_HANDLED; 254 return IRQ_HANDLED;
255 255
256 /* Other side may have missed us turning off the interrupt,
257 * but we should preserve disable semantic for virtio users. */
258 if (unlikely(vq->vring.avail->flags & VRING_AVAIL_F_NO_INTERRUPT)) {
259 pr_debug("virtqueue interrupt after disable for %p\n", vq);
260 return IRQ_HANDLED;
261 }
262
263 pr_debug("virtqueue callback for %p (%p)\n", vq, vq->vq.callback); 256 pr_debug("virtqueue callback for %p (%p)\n", vq, vq->vq.callback);
264 if (vq->vq.callback) 257 if (vq->vq.callback)
265 vq->vq.callback(&vq->vq); 258 vq->vq.callback(&vq->vq);