From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58807) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z84og-0005aS-3X for qemu-devel@nongnu.org; Thu, 25 Jun 2015 06:55:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z84oc-00074s-7b for qemu-devel@nongnu.org; Thu, 25 Jun 2015 06:55:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45847) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z84oc-00073l-2o for qemu-devel@nongnu.org; Thu, 25 Jun 2015 06:55:30 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 0D6DAC9B24 for ; Thu, 25 Jun 2015 10:55:29 +0000 (UTC) Date: Thu, 25 Jun 2015 18:55:25 +0800 From: Fam Zheng Message-ID: <20150625105525.GD12846@ad.nay.redhat.com> References: <1435223885-12745-1-git-send-email-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1435223885-12745-1-git-send-email-stefanha@redhat.com> Subject: Re: [Qemu-devel] [PATCH for-2.4] e1000: flush packets when link comes up List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: jasowang@redhat.com, qemu-devel@nongnu.org On Thu, 06/25 10:18, Stefan Hajnoczi wrote: > e1000_can_receive() checks the link up status register bit. If the bit > is clear, packets will be queued and the peer may disable receive to > avoid wasting CPU reading packets that cannot be delivered. The queue > must be flushed once the link comes back up again. > > This patch fixes broken e1000 receive with Mac OS X Snow Leopard guests > and tap networking. Flushing the queue invokes the async send callback, > which re-enables tap fd read. > > Reported-by: Jonathan Liu > Signed-off-by: Stefan Hajnoczi Reviewed-by: Fam Zheng > --- > hw/net/e1000.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/hw/net/e1000.c b/hw/net/e1000.c > index bab8e2a..5c6bcd0 100644 > --- a/hw/net/e1000.c > +++ b/hw/net/e1000.c > @@ -185,6 +185,9 @@ e1000_link_up(E1000State *s) > { > s->mac_reg[STATUS] |= E1000_STATUS_LU; > s->phy_reg[PHY_STATUS] |= MII_SR_LINK_STATUS; > + > + /* E1000_STATUS_LU is tested by e1000_can_receive() */ > + qemu_flush_queued_packets(qemu_get_queue(s->nic)); > } > > static bool > -- > 2.4.3 > >