From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E1EA1A0C53; Fri, 3 Sep 2021 10:02:37 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9E3B640DDE; Fri, 3 Sep 2021 10:02:37 +0200 (CEST) Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) by mails.dpdk.org (Postfix) with ESMTP id 35020406B4 for ; Fri, 3 Sep 2021 10:02:37 +0200 (CEST) Received: by mail-pl1-f170.google.com with SMTP id v1so2828327plo.10 for ; Fri, 03 Sep 2021 01:02:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smartx-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=URjY6EGfy5vUH5isjj9TxyREO3N35SI0gOkkEPhfNk4=; b=xQlKvjpiAyf/7lz4+LXLFs9CmGpPl+vWngjWa4MYigcnUYXYEbDiBE+OUopw5djoUI mnpr2peF6BTSIY946/q29yX/82HPSKe5w3do7X+dkv4WVhx+JJD5KEiH+DmhTj4dweWp +CUtfxz7T0dQNbNPQ6Ro8EQfjubYiqQr0COUOJq7G8BWm0P2ksPa9mAcl6CIEbIN/E+N 8crDNKmtwEBRddwzRi4mbc7C6lN9D2UyWw1q6j88WM9YAQ6SFBDf1yh8pcjcyeroA721 +9OH/d/vG4bHhy48EKZeCwlDhpLpnQ78pwpJJdOVCnooXi2dDK0gUm0g9foWCamlYWWN 1VIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=URjY6EGfy5vUH5isjj9TxyREO3N35SI0gOkkEPhfNk4=; b=jk1DeW1keKVxV70y2RaiCl2PxvK+qWTXrMsEVrcwDt5LCVyO0tjMK4FX8LfELIJ42g bO2cT0DYqGHGKghhbrJU9jT3+8yr2He81SIbyUkf0nkjpWoGl1Z/yBWsdmvQHve6PC31 Yiw9Vn36UVdA8izpERm4Nj2xVLXiYlaA1tZ8wGg9aQAg75tlR91/DFwcMpyxzQXKC1+2 +bK4h9CyT1e72cYZWVI4MfbghwjVyzPoIxC13sHsoE6P9RcQzJUEgqONtgLghEA4URMy iZn3bUPSDasmkQZbnhlV483HxR5cFX4W+FKlBzDkoinQ5QnEJXDbypXmaNc4gQlee8Sd aqBg== X-Gm-Message-State: AOAM531pdtKr0TuvCJsQoueFZwHGxq1R5dfYwCeL/bguAMsSz1+VIzq0 v0Y8PemfIXA20TzvMH8uygZTop8IdnnIW3WpJyA= X-Google-Smtp-Source: ABdhPJyCJfpFcKd/EvDMijQMbTO5NX3R3s6Svi4UtZ2pknmcAYuxUTylENg48bHPLQLJ1+Mdy8Qj8Q== X-Received: by 2002:a17:90a:a092:: with SMTP id r18mr8837340pjp.175.1630656156263; Fri, 03 Sep 2021 01:02:36 -0700 (PDT) Received: from 64-217.smartx.com ([103.97.201.35]) by smtp.gmail.com with ESMTPSA id m18sm4440185pjq.32.2021.09.03.01.02.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Sep 2021 01:02:35 -0700 (PDT) From: Li Feng To: Maxime Coquelin , Chenbo Xia Cc: dev@dpdk.org, Li Feng Date: Fri, 3 Sep 2021 16:02:03 +0800 Message-Id: <20210903080203.2495559-1-fengli@smartx.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210903075637.2201185-1-fengli@smartx.com> References: <20210903075637.2201185-1-fengli@smartx.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2] vhost: call destroy_device always in vhost_destroy_device_notify X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Vhost-user client must send the mem table, kick fd, call fd on all virtqueues, then the device will be VIRTIO_DEV_RUNNING. If the vhost-user communication is initialized partly, e.g. - When initializing the vhost-user, try to restart the vhost-user backend; - Seabios only initialized the vhost-scsi req vq. The device is not with flags VIRTIO_DEV_RUNNING.. Root Cause: The vhost session has been created, and added the scsi/blk requestq poller into reactor, but when destroying the device, the requestq is not unregistered. Reproduce the crash on spdk vhost-user backend: 1. Create a VM; 2. Mount a ISO to a VM, start the VM, don't install the OS; 3. Restart the spdk_tgt; Another discusstion is in seabiso: https://patchew.org/Seabios/20210831122339.2591585-1-fengli@smartx.com/ Signed-off-by: Li Feng --- v2: Fix the commit msg typo: vas -> virtqueues. -- lib/vhost/vhost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c index 355ff37651..191ba82c41 100644 --- a/lib/vhost/vhost.c +++ b/lib/vhost/vhost.c @@ -710,8 +710,8 @@ vhost_destroy_device_notify(struct virtio_net *dev) if (vdpa_dev) vdpa_dev->ops->dev_close(dev->vid); dev->flags &= ~VIRTIO_DEV_RUNNING; - dev->notify_ops->destroy_device(dev->vid); } + dev->notify_ops->destroy_device(dev->vid); } /* -- 2.31.1