From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40556) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWyQp-0002jk-63 for qemu-devel@nongnu.org; Tue, 01 Sep 2015 23:09:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZWyQi-0008Lw-VC for qemu-devel@nongnu.org; Tue, 01 Sep 2015 23:09:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55636) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWyQi-0008Lk-Cq for qemu-devel@nongnu.org; Tue, 01 Sep 2015 23:09:44 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 03AD14C0A7 for ; Wed, 2 Sep 2015 03:09:43 +0000 (UTC) References: <1441121206-6997-1-git-send-email-vyasevic@redhat.com> <1441121206-6997-3-git-send-email-vyasevic@redhat.com> From: Jason Wang Message-ID: <55E66874.8080908@redhat.com> Date: Wed, 2 Sep 2015 11:09:40 +0800 MIME-Version: 1.0 In-Reply-To: <1441121206-6997-3-git-send-email-vyasevic@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4 2/2] rtl8139: Do not consume the packet during overflow in standard mode. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Yasevich , qemu-devel@nongnu.org Cc: stefanha@redhat.com On 09/01/2015 11:26 PM, Vladislav Yasevich wrote: > When operation in standard mode, we currently return the size > of packet during buffer overflow. This consumes the overflow > packet. Return 0 instead so we can re-process the overflow packet > when we have room. > > This fixes issues with lost/dropped fragments of large messages. > > Signed-off-by: Vladislav Yasevich > --- > hw/net/rtl8139.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c > index 8a33466..cb51613 100644 > --- a/hw/net/rtl8139.c > +++ b/hw/net/rtl8139.c > @@ -1159,7 +1159,7 @@ static ssize_t rtl8139_do_receive(NetClientState *nc, const uint8_t *buf, size_t > s->IntrStatus |= RxOverflow; > ++s->RxMissed; > rtl8139_update_irq(s); > - return size_; > + return 0; > } > > packet_header |= RxStatusOK; Reviewed-by: Jason Wang