From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id DECCE29C7 for ; Thu, 30 Jun 2016 07:30:54 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP; 29 Jun 2016 22:30:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,550,1459839600"; d="scan'208";a="986112223" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162]) by orsmga001.jf.intel.com with ESMTP; 29 Jun 2016 22:30:53 -0700 Date: Thu, 30 Jun 2016 13:31:24 +0800 From: Yuanhan Liu To: "Loftus, Ciara" Cc: "dev@dpdk.org" , "Xie, Huawei" Message-ID: <20160630053124.GD2831@yliu-dev.sh.intel.com> References: <1467005329-4216-1-git-send-email-yuanhan.liu@linux.intel.com> <74F120C019F4A64C9B78E802F6AD4CC24F8E2D1D@IRSMSX106.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <74F120C019F4A64C9B78E802F6AD4CC24F8E2D1D@IRSMSX106.ger.corp.intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH] vhost: fix missing flag reset on stop X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jun 2016 05:30:55 -0000 On Wed, Jun 29, 2016 at 02:55:40PM +0000, Loftus, Ciara wrote: > > > > Commit 550c9d27d143 ("vhost: set/reset device flags internally") moves > > the VIRTIO_DEV_RUNNING set/reset to vhost lib. But I missed one reset > > on stop; here fixes it. > > > > Fixes: 550c9d27d143 ("vhost: set/reset device flags internally") > > > > Reported-by: Loftus Ciara > > Signed-off-by: Yuanhan Liu > > --- > > lib/librte_vhost/vhost_user/virtio-net-user.c | 4 +++- > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > diff --git a/lib/librte_vhost/vhost_user/virtio-net-user.c > > b/lib/librte_vhost/vhost_user/virtio-net-user.c > > index a6a48dc..e7c4347 100644 > > --- a/lib/librte_vhost/vhost_user/virtio-net-user.c > > +++ b/lib/librte_vhost/vhost_user/virtio-net-user.c > > @@ -317,8 +317,10 @@ user_get_vring_base(int vid, struct > > vhost_vring_state *state) > > if (dev == NULL) > > return -1; > > /* We have to stop the queue (virtio) if it is running. */ > > - if (dev->flags & VIRTIO_DEV_RUNNING) > > + if (dev->flags & VIRTIO_DEV_RUNNING) { > > + dev->flags &= ~VIRTIO_DEV_RUNNING; > > notify_ops->destroy_device(vid); > > + } > > > > /* Here we are safe to get the last used index */ > > vhost_get_vring_base(vid, state->index, state); > > -- > > 1.9.0 > > Thanks for the patch. I've tested it and it solves the issue I was seeing where destroy_device was being called too many times. > > Tested-by: Ciara Loftus Thanks for testing! Applied to dpdk-next-virtio. --yliu