]> git.baikalelectronics.ru Git - kernel.git/commit
virtio_net: Fix napi poll list corruption
authorHerbert Xu <herbert@gondor.apana.org.au>
Sat, 20 Dec 2014 00:23:27 +0000 (11:23 +1100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 22 Dec 2014 21:10:12 +0000 (16:10 -0500)
commitab90a1b3b39a74876c3e94668f927eb9f07147b5
treeffb5a2a9eac75039bd120628fed70ad8ad2b7c18
parent6b7876156fc937203622b1e86f31d904121ba26b
virtio_net: Fix napi poll list corruption

The commit c7f3160ce88637ad42bab19d9ca5ce32a1b3ebcc (net: less
interrupt masking in NAPI) breaks virtio_net in an insidious way.

It is now required that if the entire budget is consumed when poll
returns, the napi poll_list must remain empty.  However, like some
other drivers virtio_net tries to do a last-ditch check and if
there is more work it will call napi_schedule and then immediately
process some of this new work.  Should the entire budget be consumed
while processing such new work then we will violate the new caller
contract.

This patch fixes this by not touching any work when we reschedule
in virtio_net.

The worst part of this bug is that the list corruption causes other
napi users to be moved off-list.  In my case I was chasing a stall
in IPsec (IPsec uses netif_rx) and I only belatedly realised that it
was virtio_net which caused the stall even though the virtio_net
poll was still functioning perfectly after IPsec stalled.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/virtio_net.c