From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34466) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbfqY-0003dZ-6H for qemu-devel@nongnu.org; Mon, 14 Sep 2015 22:19:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZbfqU-0007Bl-V4 for qemu-devel@nongnu.org; Mon, 14 Sep 2015 22:19:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52664) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbfqU-0007Bb-PN for qemu-devel@nongnu.org; Mon, 14 Sep 2015 22:19:46 -0400 Date: Tue, 15 Sep 2015 10:19:43 +0800 From: Fam Zheng Message-ID: <20150915021943.GD14016@ad.nay.redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [RFT PATCH v1 3/3] net: smc91c111: flush packets on RCR register changes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Crosthwaite Cc: peter.maydell@linaro.org, jasowang@redhat.com, richard.purdie@linuxfoundation.org, qemu-devel@nongnu.org, stefanha@redhat.com On Thu, 09/10 21:24, Peter Crosthwaite wrote: > The SOFT_RST or RXEN in the control register can be used as a condition > to unblock the net layer via can_receive(). So check for possible > flushes on RCR changes. This will drop all pending packets on soft > reset or disable which is the functional intent of the can_receive() > logic. > > Signed-off-by: Peter Crosthwaite > --- > > hw/net/smc91c111.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/hw/net/smc91c111.c b/hw/net/smc91c111.c > index 8fc3deb..c19cdd1 100644 > --- a/hw/net/smc91c111.c > +++ b/hw/net/smc91c111.c > @@ -331,6 +331,7 @@ static void smc91c111_writeb(void *opaque, hwaddr offset, > if (s->rcr & RCR_SOFT_RST) { > smc91c111_reset(DEVICE(s)); > } > + smc91c111_flush_queued_packets(s); > return; > case 10: case 11: /* RPCR */ > /* Ignored */ > -- > 1.9.1 > > Reviewed-by: Fam Zheng This should be useful for other NICs too. Fam