qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH for-2.4 00/12] hw/net: Fix .can_receive() for NICs
@ 2015-07-14  7:53 Fam Zheng
  2015-07-14  7:53 ` [Qemu-devel] [PATCH for-2.4 01/12] xgmac: Drop packets with eth_can_rx is false Fam Zheng
                   ` (13 more replies)
  0 siblings, 14 replies; 27+ messages in thread
From: Fam Zheng @ 2015-07-14  7:53 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Peter Crosthwaite, Rob Herring, jasowang,
	Michael Walle, Gerd Hoffmann, stefanha, Edgar E. Iglesias

Since a90a742 "tap: Drop tap_can_send", all nics that returns false from
.can_receive() are required to explicitly flush the incoming queue when the
status of it is changing back to true, otherwise the backend will sop
processing more rx packets.

The purpose of this callback is to tell the peer backend (tap, socket, etc)
"hold on until guest consumes old data because my buffer is not ready". More
often than not NICs also do this when driver deactivated the card or disabled
rx, causing the packets being unnessarily queued, where they should actualy be
dropped.

This series adds such missing qemu_flush_queued_packets calls for all NICs, and
drops such unnecessary conditions in .can_receive(), so that NICs now:

  - returns false from .can_receive when guest buffers are busy.
  - calls qemu_flush_queued_packets when buffers are available again.
  - returns -1 from .receive when rx is not enabled.

e1000, ne2000, rocker and vmxnet3 are not included because they're fixed by
other patches on the list and applied to Stefan's tree.

virtio-net is covered by another thread:

https://lists.gnu.org/archive/html/qemu-devel/2015-06/msg07377.html

All other NICs are okay, as they already do the flush on the state transition
points.

Please review.

Fam Zheng (12):
  xgmac: Drop packets with eth_can_rx is false.
  pcnet: Drop pcnet_can_receive
  eepro100: Drop nic_can_receive
  usbnet: Drop usbnet_can_receive
  etsec: Move etsec_can_receive into etsec_receive
  etsec: Flush queue when rx buffer is consumed
  mcf_fec: Drop mcf_fec_can_receive
  milkymist-minimac2: Flush queued packets when link comes up
  mipsnet: Flush queued packets when receiving is enabled
  stellaris_enet: Flush queued packets when read done
  dp8393x: Flush packets when link comes up
  axienet: Flush queued packets when rx is done

 hw/net/dp8393x.c            |  8 ++++++++
 hw/net/eepro100.c           | 11 -----------
 hw/net/fsl_etsec/etsec.c    | 20 ++++++++++----------
 hw/net/fsl_etsec/etsec.h    |  4 +++-
 hw/net/fsl_etsec/rings.c    | 15 +++++++++------
 hw/net/lance.c              |  1 -
 hw/net/mcf_fec.c            |  9 +--------
 hw/net/milkymist-minimac2.c | 12 ++++++------
 hw/net/mipsnet.c            |  9 +++++++--
 hw/net/pcnet-pci.c          |  1 -
 hw/net/pcnet.c              |  9 ---------
 hw/net/pcnet.h              |  1 -
 hw/net/stellaris_enet.c     | 14 +++++---------
 hw/net/xgmac.c              |  8 ++++----
 hw/net/xilinx_axienet.c     | 22 ++++++++++++++++++++++
 hw/usb/dev-network.c        | 20 ++++----------------
 16 files changed, 79 insertions(+), 85 deletions(-)

-- 
2.4.3

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2015-07-15  8:50 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-14  7:53 [Qemu-devel] [PATCH for-2.4 00/12] hw/net: Fix .can_receive() for NICs Fam Zheng
2015-07-14  7:53 ` [Qemu-devel] [PATCH for-2.4 01/12] xgmac: Drop packets with eth_can_rx is false Fam Zheng
2015-07-14  7:53 ` [Qemu-devel] [PATCH for-2.4 02/12] pcnet: Drop pcnet_can_receive Fam Zheng
2015-07-14  7:53 ` [Qemu-devel] [PATCH for-2.4 03/12] eepro100: Drop nic_can_receive Fam Zheng
2015-07-14  7:53 ` [Qemu-devel] [PATCH for-2.4 04/12] usbnet: Drop usbnet_can_receive Fam Zheng
2015-07-14  7:53 ` [Qemu-devel] [PATCH for-2.4 05/12] etsec: Move etsec_can_receive into etsec_receive Fam Zheng
2015-07-14  9:30   ` Jason Wang
2015-07-14  9:49     ` Fam Zheng
2015-07-14  7:53 ` [Qemu-devel] [PATCH for-2.4 06/12] etsec: Flush queue when rx buffer is consumed Fam Zheng
2015-07-14  9:33   ` Jason Wang
2015-07-14  9:48     ` Fam Zheng
2015-07-15  5:10       ` Jason Wang
2015-07-15  6:01         ` Fam Zheng
2015-07-15  7:38           ` Jason Wang
2015-07-15  8:04             ` Fam Zheng
2015-07-14  7:53 ` [Qemu-devel] [PATCH for-2.4 07/12] mcf_fec: Drop mcf_fec_can_receive Fam Zheng
2015-07-14  7:53 ` [Qemu-devel] [PATCH for-2.4 08/12] milkymist-minimac2: Flush queued packets when link comes up Fam Zheng
2015-07-14 11:02   ` Michael Walle
2015-07-14 11:07     ` Fam Zheng
2015-07-15  7:50       ` Michael Walle
2015-07-14  7:53 ` [Qemu-devel] [PATCH for-2.4 09/12] mipsnet: Flush queued packets when receiving is enabled Fam Zheng
2015-07-14  7:53 ` [Qemu-devel] [PATCH for-2.4 10/12] stellaris_enet: Flush queued packets when read done Fam Zheng
2015-07-14  7:53 ` [Qemu-devel] [PATCH for-2.4 11/12] dp8393x: Flush packets when link comes up Fam Zheng
2015-07-14  7:53 ` [Qemu-devel] [PATCH for-2.4 12/12] axienet: Flush queued packets when rx is done Fam Zheng
2015-07-14  8:34 ` [Qemu-devel] [PATCH for-2.4 00/12] hw/net: Fix .can_receive() for NICs Wen Congyang
2015-07-15  8:50   ` Stefan Hajnoczi
2015-07-14 14:40 ` Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).