From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=60001 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PnWTO-0006W9-Pn for qemu-devel@nongnu.org; Thu, 10 Feb 2011 08:22:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PnWTC-0008OI-Or for qemu-devel@nongnu.org; Thu, 10 Feb 2011 08:22:08 -0500 Received: from e8.ny.us.ibm.com ([32.97.182.138]:42003) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PnWTC-0008LQ-Lt for qemu-devel@nongnu.org; Thu, 10 Feb 2011 08:22:02 -0500 Received: from d01dlp02.pok.ibm.com (d01dlp02.pok.ibm.com [9.56.224.85]) by e8.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p1A93dEo013421 for ; Thu, 10 Feb 2011 04:03:47 -0500 Received: from d01relay06.pok.ibm.com (d01relay06.pok.ibm.com [9.56.227.116]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id 7EF6D4DE8041 for ; Thu, 10 Feb 2011 08:21:04 -0500 (EST) Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay06.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p1ADLpid2392226 for ; Thu, 10 Feb 2011 08:21:51 -0500 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p1ADLpF7029856 for ; Thu, 10 Feb 2011 08:21:51 -0500 Date: Thu, 10 Feb 2011 18:51:37 +0530 From: pradeep Message-ID: <20110210185137.5ea66535@skywalker> In-Reply-To: <20110208154112.GA4341@redhat.com> References: <20110207135001.GA23844@redhat.com> <20110208174058.71d73062@skywalker> <20110208154112.GA4341@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH] vhost: disable on tap link down List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: Juan Quintela , Jes.Sorensen@redhat.com, jasowang@redhat.com, qemu-devel@nongnu.org, Alex Williamson , Sridhar Samudrala On Tue, 8 Feb 2011 17:41:12 +0200 "Michael S. Tsirkin" wrote: > On Tue, Feb 08, 2011 at 05:40:58PM +0530, pradeep wrote: > > On Mon, 7 Feb 2011 15:50:01 +0200 > > "Michael S. Tsirkin" wrote: > > > > > qemu makes it possible to disable link at tap > > > which is not communicated to the guest but > > > causes all packets to be dropped. > > > > > > Handle this with vhost simply by moving to the userspace > > > emulation. > > > > > > Note: it might be a good idea to make peer link status match > > > tap in this case, so the guest gets an event > > > and updates the carrier state. For now > > > stay bug for bug compatible with what we used to have. > > > > > > Signed-off-by: Michael S. Tsirkin > > > Reported-by: pradeep > > > --- > > > > > > Untested. > > > Pradeep, mind trying this patch out and reporting? > > > > Hi mst > > > > This patch works. Thanks > > Strange actually. Did you put the link down before guest booted? I > went to test it with set link after guest is up, and it didn't work, > I needed this on top - can you ack this in your setup as well pls? ahhhh. Old one dint. New patch works for me. Thanks mst --Pradeep > > diff --git a/hw/virtio-net.c b/hw/virtio-net.c > index fc2d6f5..3e3d73a 100644 > --- a/hw/virtio-net.c > +++ b/hw/virtio-net.c > @@ -112,14 +112,11 @@ static void virtio_net_vhost_status(VirtIONet > *n, uint8_t status) return; > } > > - if (n->nic->nc.peer->link_down) { > - return; > - } > - > if (!tap_get_vhost_net(n->nic->nc.peer)) { > return; > } > - if (!!n->vhost_started == virtio_net_started(n, status)) { > + if (!!n->vhost_started == virtio_net_started(n, status) && > + !n->nic->nc.peer->link_down) { > return; > } > if (!n->vhost_started) {