From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from thoth.sbs.de (thoth.sbs.de [192.35.17.2]) by dpdk.org (Postfix) with ESMTP id D56A96A80 for ; Wed, 12 Aug 2015 07:35:55 +0200 (CEST) Received: from mail3.siemens.de (mail3.siemens.de [139.25.208.14]) by thoth.sbs.de (8.15.1/8.15.1) with ESMTPS id t7C5Zsq7017805 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 12 Aug 2015 07:35:54 +0200 Received: from md1f2u6c.ww002.siemens.net (md1fcvac.ww300.siemens.net [139.22.121.138]) by mail3.siemens.de (8.15.1/8.15.1) with SMTP id t7C5ZrZn024494; Wed, 12 Aug 2015 07:35:54 +0200 To: "Xie, Huawei" , "dev@dpdk.org" References: <55C4E8E1.9090406@siemens.com> From: Jan Kiszka Message-ID: <55CADB38.7080904@siemens.com> Date: Wed, 12 Aug 2015 07:35:52 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit 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: Wed, 12 Aug 2015 05:35:56 -0000 On 2015-08-12 05:34, Xie, Huawei wrote: > On 8/8/2015 1:21 AM, Jan Kiszka wrote: >> On VHOST_*_RESET_OWNER, we reinitialize the device but without telling >> the application. That will cause crashes when it continues to invoke >> vhost services on the device. Fix it by calling the destruction hook if >> the device is still in use. >> >> Signed-off-by: Jan Kiszka >> --- >> >> This is the surprisingly simple answer to my questions in >> http://thread.gmane.org/gmane.comp.networking.dpdk.devel/22661. >> >> lib/librte_vhost/virtio-net.c | 3 +++ >> 1 file changed, 3 insertions(+) >> >> 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) >> >> ll_dev = get_config_ll_entry(ctx); >> >> + if ((ll_dev->dev.flags & VIRTIO_DEV_RUNNING)) >> + notify_ops->destroy_device(&ll_dev->dev); > > To me this patch makes sense here. > Whether RESET_OWNER is really needed is another question. Whenever the Is there a better way for the client for telling vhost to stop delivering, ie. touching the client's memory? Jan > vhost itself needs to process the vhost device, we need to notify the > switch application to remove it from data plane. >> + >> cleanup_device(&ll_dev->dev); >> init_device(&ll_dev->dev); >> > -- Siemens AG, Corporate Technology, CT RTC ITP SES-DE Corporate Competence Center Embedded Linux