From patchwork Fri Aug 2 19:48:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 264351 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)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 15F1C2C008C for ; Sat, 3 Aug 2013 07:34:45 +1000 (EST) Received: from localhost ([::1]:43741 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V5Mzj-0008Mc-2C for incoming@patchwork.ozlabs.org; Fri, 02 Aug 2013 17:34:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59327) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V5MzO-0008L8-MH for qemu-devel@nongnu.org; Fri, 02 Aug 2013 17:34:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V5MzI-0000Gp-Qk for qemu-devel@nongnu.org; Fri, 02 Aug 2013 17:34:22 -0400 Received: from mout.web.de ([212.227.17.12]:65133) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V5LKm-0006l9-1S for qemu-devel@nongnu.org; Fri, 02 Aug 2013 15:48:20 -0400 Received: from mchn199C.mchp.siemens.de ([95.157.58.223]) by smtp.web.de (mrweb102) with ESMTPSA (Nemesis) id 0MZDP6-1UkV6F0vIC-00KvhC for ; Fri, 02 Aug 2013 21:48:19 +0200 Message-ID: <51FC0D02.6030107@web.de> Date: Fri, 02 Aug 2013 21:48:18 +0200 From: Jan Kiszka User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: Stefan Hajnoczi X-Enigmail-Version: 1.5.2 X-Provags-ID: V03:K0:r2vPT+h1mjpkjcnEmdvsz9ja6YYZE9K1RocMB/FMjn13m/9x/Dh L5mMAjS+FUkDUeh50JDmg++X3XuIsTbIMr+eziXtqOAEB5lwdz48StZaRoRVuRPWoBcEdLY vMuXKF3kEkI7zlvqDPWeP0h4VG9CId13+Jd2lCBhTrIjn4HKSIZD8+NPl6uEPUtmKZaQdA5 ZGATbCv5rpFQK5+OBXu3g== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 212.227.17.12 Cc: qemu-devel Subject: [Qemu-devel] [PATCH] pcnet: Flush queued packets on end of STOP state 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 From: Jan Kiszka Analogously to other NICs, we have to inform the network layer when the can_receive handler will no longer report 0. Without this, we may get stuck waiting on queued incoming packets. Signed-off-by: Jan Kiszka --- hw/net/pcnet.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/hw/net/pcnet.c b/hw/net/pcnet.c index b606d2b..63aa73a 100644 --- a/hw/net/pcnet.c +++ b/hw/net/pcnet.c @@ -861,6 +861,8 @@ static void pcnet_init(PCNetState *s) s->csr[0] |= 0x0101; s->csr[0] &= ~0x0004; /* clear STOP bit */ + + qemu_flush_queued_packets(qemu_get_queue(s->nic)); } static void pcnet_start(PCNetState *s) @@ -878,6 +880,8 @@ static void pcnet_start(PCNetState *s) s->csr[0] &= ~0x0004; /* clear STOP bit */ s->csr[0] |= 0x0002; pcnet_poll_timer(s); + + qemu_flush_queued_packets(qemu_get_queue(s->nic)); } static void pcnet_stop(PCNetState *s)