Received: from eggs.gnu.org ([2001:4830:134:3::10]:43130) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yuium-0006VG-Ju for qemu-devel@nongnu.org; Tue, 19 May 2015 10:54:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yuiuj-0008JT-F3 for qemu-devel@nongnu.org; Tue, 19 May 2015 10:54:40 -0400 Date: Tue, 19 May 2015 15:54:33 +0100 From: Stefan Hajnoczi Message-ID: <20150519145433.GJ9338@stefanha-thinkpad.redhat.com> References: <1432032670-15124-1-git-send-email-famz@redhat.com> <1432032670-15124-5-git-send-email-famz@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="1y6imfT/xHuCvpN0" Content-Disposition: inline In-Reply-To: <1432032670-15124-5-git-send-email-famz@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 --1y6imfT/xHuCvpN0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 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 the > 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. This causes unbounded memory usage in QEMU because qemu_net_queue_append_iov() does not drop packets when sent_cb !=3D NULL. --1y6imfT/xHuCvpN0 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVW06pAAoJEJykq7OBq3PIJqUIAInn6vOjUc9fruGFiciQfVvN 2xNKWQad4Oc5LHRWM2kiwRgAL8pATx/DtwiRNgLSHNENOeQGR/3PcKYNSX6pyDVF wxJ+sLdrWetb/ArsSut+FH+tn/z18XboeTNEdTHoM0LiXR7TLuEj/bBvj6gftUyj O72TtUt5QqrtBD1UbTUI7oBE2X8JNc5YUvqrKHMLONN3RFDJWiB8NIsbkAPNK6kK 38dLnT/PFvy+7LSRsJcIP0I39g9frAkt93hsKMUgCul8yKX7V2ibpUNgr5meoMGW GeJQOA7Jq1XqcMiAO3nVNGnYm1Pf9HYcJQgB/CVG3FH5R5S/XYW9f9ddvVJKRxQ= =+y7r -----END PGP SIGNATURE----- --1y6imfT/xHuCvpN0--