From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40139) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFIOy-0001kk-ND for qemu-devel@nongnu.org; Wed, 15 Jul 2015 04:50:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZFIOu-0006VU-I0 for qemu-devel@nongnu.org; Wed, 15 Jul 2015 04:50:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54924) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFIOu-0006V6-5G for qemu-devel@nongnu.org; Wed, 15 Jul 2015 04:50:48 -0400 Date: Wed, 15 Jul 2015 09:50:45 +0100 From: Stefan Hajnoczi Message-ID: <20150715085045.GA28896@stefanha-thinkpad.redhat.com> References: <1436860421-4604-1-git-send-email-famz@redhat.com> <55A4C98B.2020905@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="RnlQjJ0d97Da+TV1" Content-Disposition: inline In-Reply-To: <55A4C98B.2020905@cn.fujitsu.com> Subject: Re: [Qemu-devel] [PATCH for-2.4 00/12] hw/net: Fix .can_receive() for NICs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wen Congyang Cc: Peter Maydell , Peter Crosthwaite , Fam Zheng , Rob Herring , jasowang@redhat.com, qemu-devel@nongnu.org, Michael Walle , Gerd Hoffmann , "Edgar E. Iglesias" --RnlQjJ0d97Da+TV1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jul 14, 2015 at 04:34:19PM +0800, Wen Congyang wrote: > On 07/14/2015 03:53 PM, Fam Zheng wrote: > > Since a90a742 "tap: Drop tap_can_send", all nics that returns false from > > .can_receive() are required to explicitly flush the incoming queue when= the > > status of it is changing back to true, otherwise the backend will sop > > processing more rx packets. > >=20 > > The purpose of this callback is to tell the peer backend (tap, socket, = etc) > > "hold on until guest consumes old data because my buffer is not ready".= More > > often than not NICs also do this when driver deactivated the card or di= sabled > > rx, causing the packets being unnessarily queued, where they should act= ualy be > > dropped. > >=20 > > This series adds such missing qemu_flush_queued_packets calls for all N= ICs, and > > drops such unnecessary conditions in .can_receive(), so that NICs now: > >=20 > > - returns false from .can_receive when guest buffers are busy. > > - calls qemu_flush_queued_packets when buffers are available again. > > - returns -1 from .receive when rx is not enabled. > >=20 > > e1000, ne2000, rocker and vmxnet3 are not included because they're fixe= d by > > other patches on the list and applied to Stefan's tree. > >=20 > > virtio-net is covered by another thread: > >=20 > > https://lists.gnu.org/archive/html/qemu-devel/2015-06/msg07377.html >=20 > When will the virtio-net patch be accepted? Without this patch, virtio-ne= t + tap > can not work. Fam's recent net fixes are all-or-nothing. We either have to merge all of them or none of them, because the patches remove .can_receive(). I'm waiting until reviewers are satisfied on all patches. The plan is to merge them for QEMU 2.4. If that isn't possible due to running out of time, I'll have to revert Fam's older qemu_set_fd_handler2() refactoring patches which caused the breakage you are seeing. There is not much time left for QEMU 2.4 but we're close to happy on all of Fam's patches now. --RnlQjJ0d97Da+TV1 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVph7lAAoJEJykq7OBq3PIKd4H/R5Qn7mDx4B+FH+m6BBEDwwr 7FPtZHQPnwvHQQKp9FjYchsnYVwPeToV+pjAikkfUxhjfaI5pQsaAKwMcYNb5fWd heFfvU+lj+tHkQ349ta/sMgxRCXL1dDfaR6HLEERvf3XzwvixHMUnwb3aHqbc8w6 pDAaQIbdiDMEwnvWvJC4j0MpjpFKVwh9gp0fH6HwGI6ICj9oWx5fWtia5r1jQOZm NZwyCmK3GC9UBXZ5zzKbynzlUgxpL0n3zjp8VjhRsrJ5GYsQ19JjlsVLbxqDmIEa QkyV8LXF3dhDI7/6BWrX9lyjcoUTPhV1NTxPBZlPwdRcQoVzcmmSsJvJb+c9v34= =JH5b -----END PGP SIGNATURE----- --RnlQjJ0d97Da+TV1--