From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35496) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWnSW-0004GM-MN for qemu-devel@nongnu.org; Tue, 01 Sep 2015 11:26:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZWnSV-0007mN-6n for qemu-devel@nongnu.org; Tue, 01 Sep 2015 11:26:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59658) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWnSV-0007mG-1H for qemu-devel@nongnu.org; Tue, 01 Sep 2015 11:26:51 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id C0241A4522 for ; Tue, 1 Sep 2015 15:26:50 +0000 (UTC) From: Vladislav Yasevich Date: Tue, 1 Sep 2015 11:26:46 -0400 Message-Id: <1441121206-6997-3-git-send-email-vyasevic@redhat.com> In-Reply-To: <1441121206-6997-1-git-send-email-vyasevic@redhat.com> References: <1441121206-6997-1-git-send-email-vyasevic@redhat.com> Subject: [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: qemu-devel@nongnu.org Cc: Vladislav Yasevich , jasowang@redhat.com, stefanha@redhat.com 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; -- 1.9.3