From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:34335) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QYb72-0003Pm-Ly for qemu-devel@nongnu.org; Mon, 20 Jun 2011 05:49:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QYb71-0004Kh-41 for qemu-devel@nongnu.org; Mon, 20 Jun 2011 05:49:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38702) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QYb70-0004Kc-IA for qemu-devel@nongnu.org; Mon, 20 Jun 2011 05:49:42 -0400 Message-ID: <4DFF1854.3070003@redhat.com> Date: Mon, 20 Jun 2011 11:52:20 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <4DF9BD9C.1060307@cn.fujitsu.com> <4DF9DD77.5040401@redhat.com> <20110616124651.GD14583@redhat.com> <4DFAAF00.900@cn.fujitsu.com> <4DFF0E9D.90409@redhat.com> <4DFF1596.8020902@cn.fujitsu.com> In-Reply-To: <4DFF1596.8020902@cn.fujitsu.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] do not send packet to nic if the packet will be dropped by nic List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wen Congyang Cc: qemu-devel , Aurelien Jarno , "Michael S. Tsirkin" Am 20.06.2011 11:40, schrieb Wen Congyang: > At 06/20/2011 05:10 PM, Kevin Wolf Write: >> Am 17.06.2011 03:33, schrieb Wen Congyang: >>> If !s->clock_enabled or !rtl8139_receiver_enabled(s), it means that >>> the nic will drop all packets from host. So qemu will keep getting >>> packets from host and wasting CPU on dropping packets. This seems >>> worse than packets that should be dropped but aren't. >>> >>> Signed-off-by: Wen Congyang >> >> Which bug does this change fix? I'm still not convinced that we should >> do it. > > Maybe not a bug fix now. As Michael S. Tsirkin said, if rtl8139_can_receive() > returns 1, qemu will keep getting packets from host and wasting CPU on > dropping packets. We can save CPU by return 0. Don't we waste memory instead then because we leave the packets queued indefinitely? Kevin