From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38829) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkYKW-0007a6-1y for qemu-devel@nongnu.org; Wed, 14 May 2014 08:30:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WkYKN-0004EJ-1V for qemu-devel@nongnu.org; Wed, 14 May 2014 08:30:40 -0400 Received: from mail-we0-x233.google.com ([2a00:1450:400c:c03::233]:37218) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkYKM-0004E2-Rf for qemu-devel@nongnu.org; Wed, 14 May 2014 08:30:30 -0400 Received: by mail-we0-f179.google.com with SMTP id q59so1825741wes.24 for ; Wed, 14 May 2014 05:30:29 -0700 (PDT) Date: Wed, 14 May 2014 14:30:26 +0200 From: Stefan Hajnoczi Message-ID: <20140514123026.GA16683@stefanha-thinkpad.redhat.com> References: <1398507552-50168-1-git-send-email-zhang.zhanghailiang@huawei.com> <20140426104415.GB2389@amosk.info> <20140506125550.GK15810@stefanha-thinkpad.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH] e1000/rtl8139: forbid dealing with packets when VM is paused List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Zhanghailiang Cc: Zhouxiangjiu , Peter Maydell , Peter Crosthwaite , "Michael S. Tsirkin" , Juan Quintela , QEMU Developers , "Huangpeng (Peter)" , Alex Williamson , Stefan Hajnoczi , Amos Kong , Dave Gilbert On Thu, May 08, 2014 at 12:51:05PM +0000, Zhanghailiang wrote: > > If you implement this in the net layer then that problem is easy to resolve since > > we can flush all queues when the guest resumes to get packets flowing again. > > > Do you mean we should also listen for VM runstate changes in net layer, and when detect runstate changes back to running , we flush all queues actively? Am I misunderstanding? > Or we can do it *before* qemu (exactly when it check if it can send packets) send packets to guest again, this way will be simple, but it also need know the change of runstate. Any idea? When the runstate changes back to running, we definitely need to flush queues to get packets flowing again. I think the simplest way of doing that is in the net layer so individual NICs and netdevs don't have to duplicate this code. Stefan