From mboxrd@z Thu Jan 1 00:00:00 1970 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 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="EsvprpbDhw5oeQ0Uv4Q3NIEEjPxBbXa3F" Subject: [Qemu-devel] [PATCH] pcnet: Flush queued packets on end of STOP state List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --EsvprpbDhw5oeQ0Uv4Q3NIEEjPxBbXa3F Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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) =20 s->csr[0] |=3D 0x0101; s->csr[0] &=3D ~0x0004; /* clear STOP bit */ + + qemu_flush_queued_packets(qemu_get_queue(s->nic)); } =20 static void pcnet_start(PCNetState *s) @@ -878,6 +880,8 @@ static void pcnet_start(PCNetState *s) s->csr[0] &=3D ~0x0004; /* clear STOP bit */ s->csr[0] |=3D 0x0002; pcnet_poll_timer(s); + + qemu_flush_queued_packets(qemu_get_queue(s->nic)); } =20 static void pcnet_stop(PCNetState *s) --=20 1.7.3.4 --EsvprpbDhw5oeQ0Uv4Q3NIEEjPxBbXa3F Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlH8DQIACgkQitSsb3rl5xQfsQCfRjRYW6eUXqFV3BOZ7SGxCa5x kk8AoIHsbz9CedV3BuDh3kTtS8Z9hWBp =G5J4 -----END PGP SIGNATURE----- --EsvprpbDhw5oeQ0Uv4Q3NIEEjPxBbXa3F--