From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41484) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZHT29-0002eO-Vg for qemu-devel@nongnu.org; Tue, 21 Jul 2015 04:36:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZHT24-0001aW-Rn for qemu-devel@nongnu.org; Tue, 21 Jul 2015 04:36:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55926) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZHT24-0001aF-MA for qemu-devel@nongnu.org; Tue, 21 Jul 2015 04:36:12 -0400 Date: Tue, 21 Jul 2015 09:36:07 +0100 From: Stefan Hajnoczi Message-ID: <20150721083607.GA13993@stefanha-thinkpad.redhat.com> References: <1436250630-26109-1-git-send-email-famz@redhat.com> <20150707083750.GA25892@stefanha-thinkpad.redhat.com> <20150707094156.GD28682@ad.nay.redhat.com> <20150720170720.GB3607@stefanha-thinkpad.redhat.com> <20150721012756.GB1950@ad.nay.redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="u3/rZRmxL6MmkK24" Content-Disposition: inline In-Reply-To: <20150721012756.GB1950@ad.nay.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: Fam Zheng Cc: Stefan Hajnoczi , Jason Wang , qemu-devel@nongnu.org --u3/rZRmxL6MmkK24 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jul 21, 2015 at 09:27:56AM +0800, Fam Zheng wrote: > On Mon, 07/20 18:07, Stefan Hajnoczi wrote: > > On Tue, Jul 07, 2015 at 05:41:56PM +0800, Fam Zheng wrote: > > > 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. > > > > >=20 > > > > > Signed-off-by: Fam Zheng > > > > > --- > > > > > net/hub.c | 54 +++++++++++++++++++++++++++++--------------------= ----- > > > > > 1 file changed, 29 insertions(+), 25 deletions(-) > > > >=20 > > > > 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. > > > >=20 > > > > The queue is now flushed twice because you've introduced > > > > net_hub_port_send_cb() but qemu_flush_or_purge_queued_packets() alr= eady > > > > calls net_hub_flush(). > > > >=20 > > > > If you want to get rid of net_hub_flush(), that's great. But please > > > > remove the duplicate code. > > >=20 > > > Right, I missed that. I'll remove the duplicate and send again. > >=20 > > Ping? >=20 > I thought the net_hub_flush in qemu_flush_or_purge_queued_packets already= makes > sure net-hub is working, so it's just about cleaning up. That's why I def= erred > this to 2.5. Am I wrong? My concern was that your NIC patches remove .can_receive() functions but net/hub.c still relies on them via qemu_can_send_packet(). After thinking about it more, the code should still work the same even though net_hub_can_receive() is now mostly useless and should be removed in QEMU 2.5. We can leave this patch for now. --u3/rZRmxL6MmkK24 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVrgR3AAoJEJykq7OBq3PIsioH/37hIosO6JmFuOQofT7JY0wv RT7qy/z2ags+ElwmpuP3R4bhBE9ybsKqgADUIpKBaMsU3OZ9uMJM+m1VC9wVD97T vKrHzMEO8iLm15RvFnqjnxyPrPArNcD7XwDe+9aGRDetbj5MX3ybLewTb6nWXv8l vpSq9YVZt5vKgrNb4tC1Qm+L+RVJBd8uQrtj2YxyfgGxwygZFD2nU8IQ7j4B2/fd vFAO6Tu7IuamXyonR6Do2Cn/NR+NJxjHEFtTy8pQ/MBp5hGvUdzLkvXX8ByoMs9a uVOB/Qg440Y1EfdcYYqBmKUgDcdHe8o/q1zl1nePM83K9RcBad/ni9vO+Z94Cck= =6mKq -----END PGP SIGNATURE----- --u3/rZRmxL6MmkK24--