From patchwork Fri Aug 21 21:59:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlad Yasevich X-Patchwork-Id: 509654 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id C40841402AB for ; Sat, 22 Aug 2015 08:00:14 +1000 (AEST) Received: from localhost ([::1]:44426 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZSuM8-0007dZ-P7 for incoming@patchwork.ozlabs.org; Fri, 21 Aug 2015 18:00:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39737) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZSuLY-0006kd-KT for qemu-devel@nongnu.org; Fri, 21 Aug 2015 17:59:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZSuLT-00053B-OB for qemu-devel@nongnu.org; Fri, 21 Aug 2015 17:59:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55232) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZSuLT-00052K-KG for qemu-devel@nongnu.org; Fri, 21 Aug 2015 17:59:31 -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 C9AD1A3809 for ; Fri, 21 Aug 2015 21:59:30 +0000 (UTC) Received: from flash.redhat.com ([10.3.113.14]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t7LLxSp6031771; Fri, 21 Aug 2015 17:59:30 -0400 From: Vladislav Yasevich To: qemu-devel@nongnu.org Date: Fri, 21 Aug 2015 14:59:24 -0700 Message-Id: <1440194365-27610-2-git-send-email-vyasevic@redhat.com> In-Reply-To: <1440194365-27610-1-git-send-email-vyasevic@redhat.com> References: <1440194365-27610-1-git-send-email-vyasevic@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Vladislav Yasevich , jasowang@redhat.com, stefanha@redhat.com Subject: [Qemu-devel] [PATCH 1/2] rtl8139: Do not consume the packet during overflow in standard mode. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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; } packet_header |= RxStatusOK;