From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58029) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUaLn-00026d-Uf for qemu-devel@nongnu.org; Wed, 26 Aug 2015 09:02:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZUaLi-0000kF-BK for qemu-devel@nongnu.org; Wed, 26 Aug 2015 09:02:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36209) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUaLi-0000jo-57 for qemu-devel@nongnu.org; Wed, 26 Aug 2015 09:02:42 -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 20A378E3C9 for ; Wed, 26 Aug 2015 13:02:41 +0000 (UTC) Message-ID: <55DDB8EF.3020300@redhat.com> Date: Wed, 26 Aug 2015 09:02:39 -0400 From: Vlad Yasevich MIME-Version: 1.0 References: <1440194365-27610-1-git-send-email-vyasevic@redhat.com> <1440194365-27610-2-git-send-email-vyasevic@redhat.com> <20150826121823.GE30715@stefanha-thinkpad.redhat.com> In-Reply-To: <20150826121823.GE30715@stefanha-thinkpad.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/2] rtl8139: Do not consume the packet during overflow in standard mode. Reply-To: vyasevic@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: jasowang@redhat.com, qemu-devel@nongnu.org On 08/26/2015 08:18 AM, Stefan Hajnoczi wrote: > On Fri, Aug 21, 2015 at 02:59:24PM -0700, 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 edbb61c..359e001 100644 >> --- a/hw/net/rtl8139.c >> +++ b/hw/net/rtl8139.c >> @@ -1157,7 +1157,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; > > Every .receive() return 0 must be paired with a > qemu_flush_queued_packets() call. Isn't that already there. A few drivers already return 0 to trigger a requeue. What's missing? > > Is rtl8139_RxBufPtr_write() guaranteed to be called when the guest > refills rx buffers? > It calls it on read, once it's consumed a packet, to advance to the next packet in the buffer. -vlad