From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52583) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxB0M-00037a-Cz for qemu-devel@nongnu.org; Tue, 26 May 2015 05:18:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YxB0H-0005ni-AT for qemu-devel@nongnu.org; Tue, 26 May 2015 05:18:34 -0400 Date: Tue, 26 May 2015 10:18:24 +0100 From: Stefan Hajnoczi Message-ID: <20150526091824.GC13262@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> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0vzXIDBeUiKkjNJl" Content-Disposition: inline In-Reply-To: <20150525035123.GE7135@ad.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 --0vzXIDBeUiKkjNJl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 retu= rns > > > false, the fd will not be polled in this iteration. > > >=20 > > > This is redundant with checks inside read callback. After this patch, > > > 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 when t= he > > > device status changes, this queue will be flushed. > > >=20 > > > Also remove the qemu_can_send_packet() check in netmap_send. If it's > > > true, we are good; if it's false, the qemu_sendv_packet_async would > > > return 0 and read poll will be disabled until netmap_send_completed is > > > called. > >=20 > > This causes unbounded memory usage in QEMU because > > qemu_net_queue_append_iov() does not drop packets when sent_cb !=3D NUL= L. >=20 > I think netmap_send will use "netmap_read_poll(s, false)" to stop reading= , only > the first packet will be queued. Why is it unbounded? I looked again and I agree with you. It should stop after the first packet and resume when the peer flushes the queue. Stefan --0vzXIDBeUiKkjNJl Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVZDpgAAoJEJykq7OBq3PIYOwH/1Qorucj/sDyyE2qh2Tm25k5 5pGOJcLYTFtC3rdqPxdFZN/JmL04IXcwWGLl8llMaKqz1Q11KZQZIROn0GT14a5p RmjS9yehUrZvFzvu1ZcOh1gBWbFS0kH+ZEYuZBHTrT8sEsxKH6SMDuT29bxJvk4o 6wpCbYXQ2LkFYiMXnTa4h21DbE7/v1X2nusp38MNp+HefZugTELVdx4sfxB5DweA 1T8h22gaOdQFOdCdhZMpDl7FnqKh1cDOIs5zbD+bgbONPOCijmYUaHyMIz2tXq3o NHYuUiUimHy1s0lDd1xGTt+5hO7yxsrBMQ8BTVkgI0PTpadTvulVpTN2GutwZ7I= =radD -----END PGP SIGNATURE----- --0vzXIDBeUiKkjNJl--