qemu-patch-raspberry4/hw/net
Fam Zheng 38705bb57b virtio-net: Flush incoming queues when DRIVER_OK is being set
This patch fixes network hang after "stop" then "cont", while network
packets keep arriving.

Tested both manually (tap, host pinging guest) and with Jason's qtest
series (plus his "[PATCH 2.4] socket: pass correct size in
net_socket_send()" fix).

As virtio_net_set_status is called when guest driver is setting status
byte and when vm state is changing, it is a good opportunity to flush
queued packets.

This is necessary because during vm stop the backend (e.g. tap) would
stop rx processing after .can_receive returns false, until the queue is
explicitly flushed or purged.

The other interesting condition in .can_receive, virtio_queue_ready(),
is handled by virtio_net_handle_rx() when guest kicks; the 3rd condition
is invalid queue index which doesn't need flushing.

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-07-20 14:19:41 +03:00
..
fsl_etsec etsec: Replace qdev_init() by qdev_init_nofail() 2015-02-24 00:19:05 +01:00
rocker rocker: mark copy-to-cpu pkts as forwarding offloaded 2015-07-07 13:13:22 +01:00
allwinner_emac.c net: remove all cleanup methods from NIC NetClientInfos 2015-01-12 10:16:23 +00:00
cadence_gem.c cadence_gem: Fix Rx buffer size field mask 2015-06-03 16:03:03 +03:00
dp8393x.c net/dp8393x: fix hardware reset 2015-06-11 10:13:30 +01:00
e1000.c e1000: flush packets when link comes up 2015-07-07 13:10:26 +01:00
e1000_regs.h e1000: improve auto-negotiation reporting via mii-tool 2014-06-23 17:38:00 +03:00
eepro100.c pci: Trivial device model conversions to realize 2015-02-26 12:42:16 +01:00
etraxfs_eth.c net: remove all cleanup methods from NIC NetClientInfos 2015-01-12 10:16:23 +00:00
lan9118.c net: remove all cleanup methods from NIC NetClientInfos 2015-01-12 10:16:23 +00:00
lance.c pcnet: pcnet_common_init() always returns 0, change to void 2015-02-26 12:42:16 +01:00
Makefile.objs qmp/hmp: add rocker device support 2015-06-12 13:42:17 +01:00
mcf_fec.c net: remove all cleanup methods from NIC NetClientInfos 2015-01-12 10:16:23 +00:00
milkymist-minimac2.c net: remove all cleanup methods from NIC NetClientInfos 2015-01-12 10:16:23 +00:00
mipsnet.c net: remove all cleanup methods from NIC NetClientInfos 2015-01-12 10:16:23 +00:00
ne2000-isa.c net: remove all cleanup methods from NIC NetClientInfos 2015-01-12 10:16:23 +00:00
ne2000.c pci: Trivial device model conversions to realize 2015-02-26 12:42:16 +01:00
ne2000.h ne2000: pass device to ne2000_setup_io, use it as owner 2013-07-04 17:42:46 +02:00
opencores_eth.c net: remove all cleanup methods from NIC NetClientInfos 2015-01-12 10:16:23 +00:00
pcnet-pci.c pcnet: Convert to realize 2015-02-26 12:42:17 +01:00
pcnet.c pcnet: force the buffer access to be in bounds during tx 2015-06-10 15:03:02 +01:00
pcnet.h pcnet: pcnet_common_init() always returns 0, change to void 2015-02-26 12:42:16 +01:00
rtl8139.c migration: Use normal VMStateDescriptions for Subsections 2015-06-12 06:53:57 +02:00
smc91c111.c net: remove all cleanup methods from NIC NetClientInfos 2015-01-12 10:16:23 +00:00
spapr_llan.c spapr: Merge sPAPREnvironment into sPAPRMachineState 2015-07-07 17:44:50 +02:00
stellaris_enet.c net: remove all cleanup methods from NIC NetClientInfos 2015-01-12 10:16:23 +00:00
vhost_net.c Revert "vhost-user: add multi queue support" 2015-07-20 14:19:40 +03:00
virtio-net.c virtio-net: Flush incoming queues when DRIVER_OK is being set 2015-07-20 14:19:41 +03:00
vmware_utils.h exec: Make stb_phys input an AddressSpace 2014-02-11 22:57:38 +10:00
vmxnet3.c vmxnet3: Fix incorrect small packet padding 2015-07-07 13:10:26 +01:00
vmxnet3.h vmxnet3: Eliminate __packed redefined warning 2013-09-06 17:25:55 +02:00
vmxnet_debug.h hw: move target-independent files to subdirectories 2013-04-08 18:13:12 +02:00
vmxnet_rx_pkt.c vmxnet: Remove unused function vmxnet_rx_pkt_get_num_frags() 2015-04-30 16:05:48 +03:00
vmxnet_rx_pkt.h vmxnet: Remove unused function vmxnet_rx_pkt_get_num_frags() 2015-04-30 16:05:48 +03:00
vmxnet_tx_pkt.c misc: Use g_assert_not_reached for code which is expected to be unreachable 2013-07-27 11:22:54 +04:00
vmxnet_tx_pkt.h hw: move target-independent files to subdirectories 2013-04-08 18:13:12 +02:00
xen_nic.c hw/net/xen_nic.c: Set 'netdev->mac' to NULL after free it 2015-01-12 10:16:23 +00:00
xgmac.c net: remove all cleanup methods from NIC NetClientInfos 2015-01-12 10:16:23 +00:00
xilinx_axienet.c Include qapi/qmp/qerror.h exactly where needed 2015-06-22 18:20:41 +02:00
xilinx_ethlite.c xilinx_ethlite: Clean up after commit 2f991ad 2015-03-10 08:15:33 +03:00