From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46739) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yx8jU-0007u1-5Y for qemu-devel@nongnu.org; Tue, 26 May 2015 02:53:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yx8jT-0004u8-83 for qemu-devel@nongnu.org; Tue, 26 May 2015 02:53:00 -0400 Date: Tue, 26 May 2015 14:52:48 +0800 From: Fam Zheng Message-ID: <20150526065248.GB13749@ad.nay.redhat.com> References: <1432032670-15124-1-git-send-email-famz@redhat.com> <1432032670-15124-4-git-send-email-famz@redhat.com> <20150519144830.GI9338@stefanha-thinkpad.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150519144830.GI9338@stefanha-thinkpad.redhat.com> Subject: Re: [Qemu-devel] [Qemu-block] [PATCH v3 03/13] l2tpv3: Drop l2tpv3_can_send List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: 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:48, Stefan Hajnoczi wrote: > On Tue, May 19, 2015 at 10:51:00AM +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->msgvec 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. > > This doesn't work because s->msgvec can fill up when > qemu_can_send_packet() returns false. At that point we burn 100% CPU > because the file descriptor is still being monitored. If qemu_can_send_packet returns false, we do stop monitoring the fd. In net_l2tpv3_process_queue: size = qemu_send_packet_async( &s->nc, vec->iov_base, data_size, l2tpv3_send_completed ); if (size == 0) { l2tpv3_read_poll(s, false); } The packet is queued and size is 0, so the read poll will be disabled until it's flushed. What am I missing? Fam