From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34538) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCPO8-0004fs-L7 for qemu-devel@nongnu.org; Tue, 07 Jul 2015 05:42:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZCPO4-0006qA-6w for qemu-devel@nongnu.org; Tue, 07 Jul 2015 05:42:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38230) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCPO4-0006q4-1T for qemu-devel@nongnu.org; Tue, 07 Jul 2015 05:42:00 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 74F7819F221 for ; Tue, 7 Jul 2015 09:41:59 +0000 (UTC) Date: Tue, 7 Jul 2015 17:41:56 +0800 From: Fam Zheng Message-ID: <20150707094156.GD28682@ad.nay.redhat.com> References: <1436250630-26109-1-git-send-email-famz@redhat.com> <20150707083750.GA25892@stefanha-thinkpad.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150707083750.GA25892@stefanha-thinkpad.redhat.com> Subject: Re: [Qemu-devel] [PATCH v2] net-hub: Drop can_receive List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Jason Wang , qemu-devel@nongnu.org On Tue, 07/07 09:37, Stefan Hajnoczi wrote: > On Tue, Jul 07, 2015 at 02:30:30PM +0800, Fam Zheng wrote: > > This moves the semantics from net_hub_port_can_receive to receive > > functions, by returning 0 if all receiving ports return 0. Also, > > remember to flush the source port's queue in that case. > > > > Signed-off-by: Fam Zheng > > --- > > net/hub.c | 54 +++++++++++++++++++++++++++++------------------------- > > 1 file changed, 29 insertions(+), 25 deletions(-) > > This patch revision doesn't take into account the special case code in > qemu_flush_or_purge_queued_packets(), which I mentioned in my reply to > the previous revision of this patch. > > The queue is now flushed twice because you've introduced > net_hub_port_send_cb() but qemu_flush_or_purge_queued_packets() already > calls net_hub_flush(). > > If you want to get rid of net_hub_flush(), that's great. But please > remove the duplicate code. Right, I missed that. I'll remove the duplicate and send again.