From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from paradis.irqsave.net (LPuteaux-656-1-25-125.w80-12.abo.wanadoo.fr [80.12.84.125]) by dpdk.org (Postfix) with ESMTP id 4980D567F for ; Thu, 26 Feb 2015 16:29:01 +0100 (CET) Received: from irqsave.net (laure.irqsave.net [192.168.77.2]) by paradis.irqsave.net (Postfix) with ESMTP id 2D14911E14E for ; Thu, 26 Feb 2015 16:29:01 +0100 (CET) Resent-From: =?iso-8859-1?Q?Beno=EEt?= Canet Resent-Date: Thu, 26 Feb 2015 16:29:01 +0100 Resent-Message-ID: <20150226152901.GB12516@irqsave.net> Resent-To: dev@dpdk.org Date: Thu, 26 Feb 2015 16:28:41 +0100 From: =?iso-8859-1?Q?Beno=EEt?= Canet To: huawei.xie@intel.com Message-ID: <20150226152841.GA12516@irqsave.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.5.23 (2014-03-12) Subject: [dpdk-dev] vhost-user deconnection bug 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, 26 Feb 2015 15:29:01 -0000 Hi Xie, I connected a QEMU from git master with the vhost-user from git master and noticed the following bug. In the following code: void user_destroy_device(struct vhost_device_ctx ctx) { struct virtio_net *dev = get_device(ctx); if (dev && (dev->flags & VIRTIO_DEV_RUNNING)) notify_ops->destroy_device(dev); if (dev && dev->mem) { free_mem_region(dev); free(dev->mem); dev->mem = NULL; } } The if (dev && (dev->flags & VIRTIO_DEV_RUNNING)) is evaluated false and notify_ops->destroy_device(dev); is not called when QEMU terminate and provocate the deconnexion. As a consequence any piece of code busy polling or bursting on the vhost-user device will segfault since it will not be notified of the deconnexion. By the way VIRTIO_DEV_RUNNING does not seem to be set anywhere. Best regards Benoît