From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36349) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yzozj-0002ys-57 for qemu-devel@nongnu.org; Tue, 02 Jun 2015 12:24:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yzozf-0004wu-VM for qemu-devel@nongnu.org; Tue, 02 Jun 2015 12:24:51 -0400 Date: Tue, 2 Jun 2015 17:24:44 +0100 From: Stefan Hajnoczi Message-ID: <20150602162444.GG8199@stefanha-thinkpad.redhat.com> References: <1432032670-15124-1-git-send-email-famz@redhat.com> <1432032670-15124-5-git-send-email-famz@redhat.com> <20150519145433.GJ9338@stefanha-thinkpad.redhat.com> <20150525035123.GE7135@ad.nay.redhat.com> <20150526091824.GC13262@stefanha-thinkpad.redhat.com> <20150527072438.GB1751@dhcp-14-238.nay.redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="reI/iBAAp9kzkmX4" Content-Disposition: inline In-Reply-To: <20150527072438.GB1751@dhcp-14-238.nay.redhat.com> Subject: Re: [Qemu-devel] [PATCH v3 04/13] netmap: Drop netmap_can_send List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: Kevin Wolf , qemu-block@nongnu.org, Juan Quintela , Jason Wang , qemu-devel@nongnu.org, Vincenzo Maffione , "Vassili Karpov (malc)" , Gerd Hoffmann , Stefan Hajnoczi , Amit Shah , Paolo Bonzini , Giuseppe Lettieri , Luigi Rizzo --reI/iBAAp9kzkmX4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 27, 2015 at 03:24:38PM +0800, Fam Zheng wrote: > On Tue, 05/26 10:18, Stefan Hajnoczi wrote: > > On Mon, May 25, 2015 at 11:51:23AM +0800, Fam Zheng wrote: > > > On Tue, 05/19 15:54, Stefan Hajnoczi wrote: > > > > On Tue, May 19, 2015 at 10:51:01AM +0000, Fam Zheng wrote: > > > > > This callback is called by main loop before polling s->fd, if it = returns > > > > > false, the fd will not be polled in this iteration. > > > > >=20 > > > > > This is redundant with checks inside read callback. After this pa= tch, > > > > > the data will be copied from s->fd to s->iov when it arrives. If = the > > > > > device can't receive, it will be queued to incoming_queue, and wh= en the > > > > > device status changes, this queue will be flushed. > > > > >=20 > > > > > Also remove the qemu_can_send_packet() check in netmap_send. If i= t's > > > > > true, we are good; if it's false, the qemu_sendv_packet_async wou= ld > > > > > return 0 and read poll will be disabled until netmap_send_complet= ed is > > > > > called. > > > >=20 > > > > This causes unbounded memory usage in QEMU because > > > > qemu_net_queue_append_iov() does not drop packets when sent_cb !=3D= NULL. > > >=20 > > > I think netmap_send will use "netmap_read_poll(s, false)" to stop rea= ding, only > > > the first packet will be queued. Why is it unbounded? > >=20 > > I looked again and I agree with you. It should stop after the first > > packet and resume when the peer flushes the queue. > >=20 >=20 > The other patches (socket and tap) have the same rationale. Are you happy= with > this appraoch? Yes, but I have a question on the tap patch. --reI/iBAAp9kzkmX4 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVbdjMAAoJEJykq7OBq3PIpUsH/jf6oy9rFmaEWS8t9YfWDE79 ptsY86tZt4AImbywISJcLSQfaxotiKKYTB/M0Eo9yWnyrsbbxxHQwAExM5KO5kuS THhdQ0VjztpysCdknARHjB3YmB/6gNSCLTfDmfyatV0g3+OvqTXsqkXb0EHQZTWx V4wogK2Un41hJog6Q4gx9QfayPvTkA3FE+tkAzQ9ujjvWN3x+qSx4T36EUJQOuiy mIPsrqJpnrqK95YfIC97viMMsTVIXi8OTCU8e/CsqTLKT1eoiA4MvNCpquID5Zwx CXfSVCDqlSW9T1UyV13hPxKPa7CrtozaIBeqN0rdzvfV/bG0IhWobp1wS3Z8gqs= =McWW -----END PGP SIGNATURE----- --reI/iBAAp9kzkmX4--