From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 90057952 for ; Sat, 8 Aug 2015 02:25:30 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP; 07 Aug 2015 17:25:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,632,1432623600"; d="scan'208";a="744466571" Received: from kmsmsx152.gar.corp.intel.com ([172.21.73.87]) by orsmga001.jf.intel.com with ESMTP; 07 Aug 2015 17:25:28 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by KMSMSX152.gar.corp.intel.com (172.21.73.87) with Microsoft SMTP Server (TLS) id 14.3.224.2; Sat, 8 Aug 2015 08:25:27 +0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.126]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.188]) with mapi id 14.03.0224.002; Sat, 8 Aug 2015 08:25:25 +0800 From: "Ouyang, Changchun" To: Jan Kiszka , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] vchost: Notify application of ownership change Thread-Index: AQHQ0TV2jPqGkzIBnE6JWkov2utqcp4BPY5g Date: Sat, 8 Aug 2015 00:25:25 +0000 Message-ID: References: <55C4E8E1.9090406@siemens.com> In-Reply-To: <55C4E8E1.9090406@siemens.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] vchost: Notify application of ownership change 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: Sat, 08 Aug 2015 00:25:31 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Jan Kiszka > Sent: Saturday, August 8, 2015 1:21 AM > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH] vchost: Notify application of ownership chang= e Vchost should be vhost in the title >=20 > On VHOST_*_RESET_OWNER, we reinitialize the device but without telling > the application. That will cause crashes when it continues to invoke vhos= t > services on the device. Fix it by calling the destruction hook if the dev= ice is > still in use. What's your qemu version? Any validation work on this patch? >=20 > Signed-off-by: Jan Kiszka > --- >=20 > This is the surprisingly simple answer to my questions in > http://thread.gmane.org/gmane.comp.networking.dpdk.devel/22661. >=20 > lib/librte_vhost/virtio-net.c | 3 +++ > 1 file changed, 3 insertions(+) >=20 > diff --git a/lib/librte_vhost/virtio-net.c b/lib/librte_vhost/virtio-net.= c index > b520ec5..3c5b5b2 100644 > --- a/lib/librte_vhost/virtio-net.c > +++ b/lib/librte_vhost/virtio-net.c > @@ -402,6 +402,9 @@ reset_owner(struct vhost_device_ctx ctx) >=20 > ll_dev =3D get_config_ll_entry(ctx); >=20 > + if ((ll_dev->dev.flags & VIRTIO_DEV_RUNNING)) > + notify_ops->destroy_device(&ll_dev->dev); > + I am not sure whether destroy_device here will affect the second time init_= device(below) and new_device(after the reset) or not. Need validation. > cleanup_device(&ll_dev->dev); > init_device(&ll_dev->dev); >=20 > -- > 2.1.4