From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57050) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFbtA-0002qq-7r for qemu-devel@nongnu.org; Thu, 16 Jul 2015 01:39:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZFbt5-0001kZ-V6 for qemu-devel@nongnu.org; Thu, 16 Jul 2015 01:39:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33949) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFbt5-0001kR-Np for qemu-devel@nongnu.org; Thu, 16 Jul 2015 01:39:15 -0400 Message-ID: <55A7436E.5060503@redhat.com> Date: Thu, 16 Jul 2015 13:38:54 +0800 From: Jason Wang MIME-Version: 1.0 References: <1436955553-22791-1-git-send-email-famz@redhat.com> In-Reply-To: <1436955553-22791-1-git-send-email-famz@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 for-2.4 00/12] hw/net: Fix .can_receive() for NICs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng , qemu-devel@nongnu.org Cc: Peter Maydell , Peter Crosthwaite , Rob Herring , Michael Walle , Gerd Hoffmann , stefanha@redhat.com, "Edgar E. Iglesias" On 07/15/2015 06:19 PM, Fam Zheng wrote: > v2: Don't use BH in patches 6 and 12. [Jason] > Add Stefan's reviewed-by in all others. > Drop trace point in patch 8 and move function body upward. [Michael] > > 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: > > - return false from .can_receive when guest buffers are busy. > - call qemu_flush_queued_packets when buffers are available again. > - return -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 series: > > https://lists.gnu.org/archive/html/qemu-devel/2015-06/msg07377.html ^U > > http://patchwork.ozlabs.org/patch/495379/ (the subject should have v2, my bad.) > > All other NICs are okay, as they already do the flush on the state transition > points. > > Please review. Reviewed-by: Jason Wang Thanks > > 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 | 17 +++++++++++------ > hw/net/lance.c | 1 - > hw/net/mcf_fec.c | 9 +-------- > hw/net/milkymist-minimac2.c | 33 ++++++++++++++++----------------- > 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 | 17 +++++++++++++---- > hw/usb/dev-network.c | 20 ++++---------------- > trace-events | 1 - > 17 files changed, 82 insertions(+), 101 deletions(-) >