From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tetsuya Mukawa Subject: Re: [PATCH] vhost: make destroy callback on VHOST_USER_RESET_OWNER Date: Tue, 10 Nov 2015 12:51:42 +0900 Message-ID: <564169CE.5020909@igel.co.jp> References: <1447121713-12095-1-git-send-email-rlane@bigswitch.com> <20151110022523.GR2326@yliu-dev.sh.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org To: Yuanhan Liu , Rich Lane Return-path: Received: from mail-pa0-f53.google.com (mail-pa0-f53.google.com [209.85.220.53]) by dpdk.org (Postfix) with ESMTP id 07D485921 for ; Tue, 10 Nov 2015 04:51:47 +0100 (CET) Received: by pabfh17 with SMTP id fh17so220713320pab.0 for ; Mon, 09 Nov 2015 19:51:46 -0800 (PST) In-Reply-To: <20151110022523.GR2326@yliu-dev.sh.intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 2015/11/10 11:25, Yuanhan Liu wrote: > On Mon, Nov 09, 2015 at 06:15:13PM -0800, Rich Lane wrote: >> QEMU sends this message first when shutting down. There was previously no way >> for the dataplane to know that the virtio_net instance had become unusable and >> it would segfault when trying to do RX/TX. >> >> Signed-off-by: Rich Lane > Thanks. Even I have same patch in my patch queue (I have some other > issues to fix), you got my ack. > > Acked-by: Yuanhan Liu > > --yliu > Hi Liu and Rich, How about saving "dev->ifname" while processing reset_owner like "dev->device_fh"? It was only set when connection is established. But so far, it will be cleared when reset_owner message comes. Probably it should be cleared when unix domain socket connection is closed. Thanks, Tetsuya >> --- >> 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 14278de..39a6a5e 100644 >> --- a/lib/librte_vhost/virtio-net.c >> +++ b/lib/librte_vhost/virtio-net.c >> @@ -436,6 +436,9 @@ reset_owner(struct vhost_device_ctx ctx) >> if (dev == NULL) >> return -1; >> >> + if (dev->flags & VIRTIO_DEV_RUNNING) >> + notify_ops->destroy_device(dev); >> + >> device_fh = dev->device_fh; >> cleanup_device(dev); >> init_device(dev); >> -- >> 1.9.1