linux/drivers/net
Michael S. Tsirkin cbdadbbf0c virtio_net: fix race in RX VQ processing
virtio net called virtqueue_enable_cq on RX path after napi_complete, so
with NAPI_STATE_SCHED clear - outside the implicit napi lock.
This violates the requirement to synchronize virtqueue_enable_cq wrt
virtqueue_add_buf.  In particular, used event can move backwards,
causing us to lose interrupts.
In a debug build, this can trigger panic within START_USE.

Jason Wang reports that he can trigger the races artificially,
by adding udelay() in virtqueue_enable_cb() after virtio_mb().

However, we must call napi_complete to clear NAPI_STATE_SCHED before
polling the virtqueue for used buffers, otherwise napi_schedule_prep in
a callback will fail, causing us to lose RX events.

To fix, call virtqueue_enable_cb_prepare with NAPI_STATE_SCHED
set (under napi lock), later call virtqueue_poll with
NAPI_STATE_SCHED clear (outside the lock).

Reported-by: Jason Wang <jasowang@redhat.com>
Tested-by: Jason Wang <jasowang@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-07-09 12:45:37 -07:00
..
appletalk
arcnet
bonding Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-07-03 14:55:13 -07:00
caif caif: CAIF_VIRTIO should depend on HAS_DMA 2013-05-11 16:28:24 -07:00
can can: at91_can: Use of_match_ptr() 2013-06-27 15:15:42 +02:00
cris
dsa
ethernet net/cadence/macb: fix bug/typo in extracting gem_irq_read_clear bit 2013-07-09 12:43:16 -07:00
fddi net/fddi/skfp/skfddi: Use module_pci_driver to register driver 2013-05-22 14:35:05 -07:00
hamradio net: pass info struct via netdevice notifier 2013-05-28 13:11:01 -07:00
hippi net/hippi/rrunner: Use module_pci_driver to register driver 2013-05-22 14:35:05 -07:00
hyperv Fix the VLAN_TAG_PRESENT in netvsc_recv_callback() 2013-06-17 15:58:11 -07:00
ieee802154
irda net: irda: remove unnecessary platform_set_drvdata() 2013-05-27 22:34:51 -07:00
phy Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-06-05 16:37:30 -07:00
plip
ppp net: pass info struct via netdevice notifier 2013-05-28 13:11:01 -07:00
slip
team Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-06-19 16:49:39 -07:00
usb Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-07-03 14:55:13 -07:00
vmxnet3
wan Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-07-03 14:55:13 -07:00
wimax
wireless Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next 2013-07-01 13:21:17 -07:00
xen-netback xen-netback: xenbus.c: use more current logging styles 2013-07-02 00:52:55 -07:00
dummy.c
eql.c
ifb.c
Kconfig packet: nlmon: virtual netlink monitoring device for packet sockets 2013-06-24 16:39:05 -07:00
LICENSE.SRC
loopback.c
macvlan.c macvtap: Let TUNSETOFFLOAD actually controll offload features. 2013-06-25 16:44:56 -07:00
macvtap.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-07-03 14:55:13 -07:00
Makefile packet: nlmon: virtual netlink monitoring device for packet sockets 2013-06-24 16:39:05 -07:00
mdio.c
mii.c
netconsole.c net: pass info struct via netdevice notifier 2013-05-28 13:11:01 -07:00
nlmon.c nlmon: use standard rtnetlink link api for add/del devices 2013-07-02 12:53:17 -07:00
ntb_netdev.c ntb_netdev: remove from list on exit 2013-05-15 10:58:14 -07:00
rionet.c
sb1000.c
Space.c
sungem_phy.c
tun.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-07-03 14:55:13 -07:00
veth.c veth: remove redundant call of dev_alloc_name 2013-06-12 01:21:20 -07:00
virtio_net.c virtio_net: fix race in RX VQ processing 2013-07-09 12:45:37 -07:00
vxlan.c vxlan: fix function name spelling 2013-06-25 17:06:01 -07:00
xen-netfront.c xen: Use more current logging styles 2013-07-01 13:31:25 -07:00