From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57174) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YwjQV-00063D-RM for qemu-devel@nongnu.org; Sun, 24 May 2015 23:51:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YwjQR-0002TN-4d for qemu-devel@nongnu.org; Sun, 24 May 2015 23:51:43 -0400 Date: Mon, 25 May 2015 11:51:23 +0800 From: Fam Zheng Message-ID: <20150525035123.GE7135@ad.nay.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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150519145433.GJ9338@stefanha-thinkpad.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: Stefan Hajnoczi 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 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. > > > > 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. > > > > 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 != NULL. 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? Fam