From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 0EFB82A6C for ; Wed, 29 Jun 2016 16:55:43 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP; 29 Jun 2016 07:55:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,547,1459839600"; d="scan'208";a="837401420" Received: from irsmsx107.ger.corp.intel.com ([163.33.3.99]) by orsmga003.jf.intel.com with ESMTP; 29 Jun 2016 07:55:41 -0700 Received: from irsmsx156.ger.corp.intel.com (10.108.20.68) by IRSMSX107.ger.corp.intel.com (163.33.3.99) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 29 Jun 2016 15:55:40 +0100 Received: from irsmsx106.ger.corp.intel.com ([169.254.8.145]) by IRSMSX156.ger.corp.intel.com ([10.108.20.68]) with mapi id 14.03.0248.002; Wed, 29 Jun 2016 15:55:41 +0100 From: "Loftus, Ciara" To: Yuanhan Liu , "dev@dpdk.org" CC: "Xie, Huawei" Thread-Topic: [dpdk-dev] [PATCH] vhost: fix missing flag reset on stop Thread-Index: AQHR0DTfBtNDknmNw0ek6Nzq1bIQ+aAAi13w Date: Wed, 29 Jun 2016 14:55:40 +0000 Message-ID: <74F120C019F4A64C9B78E802F6AD4CC24F8E2D1D@IRSMSX106.ger.corp.intel.com> References: <1467005329-4216-1-git-send-email-yuanhan.liu@linux.intel.com> In-Reply-To: <1467005329-4216-1-git-send-email-yuanhan.liu@linux.intel.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNzIxNTY5ODItNWVmNC00ZmMzLWE2MDgtYjFhOGJhZGQyYjZmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6InlGWHV5VnRXK3VVa3llXC93ZWpxVllHbUJxRmlkYmJUbjRkbVdUeDZDYlBjPSJ9 x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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: Wed, 29 Jun 2016 14:55:44 -0000 >=20 > 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. >=20 > Fixes: 550c9d27d143 ("vhost: set/reset device flags internally") >=20 > 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(-) >=20 > 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 =3D=3D 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 &=3D ~VIRTIO_DEV_RUNNING; > notify_ops->destroy_device(vid); > + } >=20 > /* 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 w= here destroy_device was being called too many times. Tested-by: Ciara Loftus