From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:41371) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uf8Xt-0005IY-1H for qemu-devel@nongnu.org; Wed, 22 May 2013 08:53:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uf8Xr-0007aK-Hb for qemu-devel@nongnu.org; Wed, 22 May 2013 08:53:32 -0400 Message-ID: <519CBFCA.4060803@suse.de> Date: Wed, 22 May 2013 14:53:30 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1369227018-27837-1-git-send-email-stefanha@redhat.com> In-Reply-To: <1369227018-27837-1-git-send-email-stefanha@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] rtl8139: flush queued packets when RxBufPtr is written List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: oliver.francke@filoo.de, qemu-devel@nongnu.org, qemu-stable Am 22.05.2013 14:50, schrieb Stefan Hajnoczi: > Net queues support efficient "receive disable". For example, tap's fil= e > descriptor will not be polled while its peer has receive disabled. Thi= s > saves CPU cycles for needlessly copying and then dropping packets which > the peer cannot receive. >=20 > rtl8139 is missing the qemu_flush_queued_packets() call that wakes the > queue up when receive becomes possible again. >=20 > As a result, the Windows 7 guest driver reaches a state where the > rtl8139 cannot receive packets. The driver has actually refilled the > receive buffer but we never resume reception. >=20 > The bug can be reproduced by running a large FTP 'get' inside a Windows > 7 guest: >=20 > $ qemu -netdev tap,id=3Dtap0,... > -device rtl8139,netdev=3Dtap0 >=20 > The Linux guest driver does not trigger the bug, probably due to a > different buffer management strategy. >=20 > Reported-by: Oliver Francke > Signed-off-by: Stefan Hajnoczi Sounds as if we should Cc: qemu-stable@nongnu.org Andreas > --- > hw/net/rtl8139.c | 3 +++ > 1 file changed, 3 insertions(+) >=20 > diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c > index 9369507..7993f9f 100644 > --- a/hw/net/rtl8139.c > +++ b/hw/net/rtl8139.c > @@ -2575,6 +2575,9 @@ static void rtl8139_RxBufPtr_write(RTL8139State *= s, uint32_t val) > /* this value is off by 16 */ > s->RxBufPtr =3D MOD2(val + 0x10, s->RxBufferSize); > =20 > + /* more buffer space may be available so try to receive */ > + qemu_flush_queued_packets(qemu_get_queue(s->nic)); > + > DPRINTF(" CAPR write: rx buffer length %d head 0x%04x read 0x%04x\= n", > s->RxBufferSize, s->RxBufAddr, s->RxBufPtr); > } >=20 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg