]> git.baikalelectronics.ru Git - kernel.git/commit
virtio: handle interrupts after callbacks turned off
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 5 Feb 2008 04:50:04 +0000 (23:50 -0500)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 4 Feb 2008 12:50:04 +0000 (23:50 +1100)
commit4a153b90ae555fadb5b9992dfbdc06cfae258b36
treed62e7dcc09dddd0edc6d507e7b219c16e66d3b02
parentca5e0451def021b11192130c9afa266892794b40
virtio: handle interrupts after callbacks turned off

Anthony Liguori found double interrupt suppression in the virtio_net
driver, triggered by two skb_recv_done's in a row.  This is because
virtio_ring's interrupt suppression is a best-effort optimization: it
contains no synchronization so the host can miss it and still send
interrupts.

But it's certainly nicer for virtio users if calling disable_cb
actually disables callbacks, so we check for the race in the interrupt
routine.

Note: SMP guests might require syncronization here, but since
disable_cb is actually called from interrupt context, there has to be
some form of synchronization before the next same interrupt handler is
called (Linux guarantees that the same device's irq handler will never
run simultanously on multiple CPUs).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
drivers/virtio/virtio_ring.c