DPDK patches and discussions
 help / color / mirror / Atom feed
From: Li Feng <fengli@smartx.com>
To: Maxime Coquelin <maxime.coquelin@redhat.com>,
	Chenbo Xia <chenbo.xia@intel.com>
Cc: dev@dpdk.org, Li Feng <fengli@smartx.com>
Subject: [dpdk-dev] [PATCH] vhost: call destroy_device always in vhost_destroy_device_notify
Date: Fri,  3 Sep 2021 15:56:37 +0800	[thread overview]
Message-ID: <20210903075637.2201185-1-fengli@smartx.com> (raw)

Vhost-user client must send the mem table, kick fd, call fd on all vas,
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 <fengli@smartx.com>
---
 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


             reply	other threads:[~2021-09-03  7:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-03  7:56 Li Feng [this message]
2021-09-03  8:02 ` [dpdk-dev] [PATCH v2] " Li Feng
2021-10-14 12:00   ` Maxime Coquelin
2021-10-14 12:12     ` Li Feng
2021-10-14 12:28       ` Maxime Coquelin
2021-10-14 12:49         ` Li Feng
2021-11-05  3:18           ` Li Feng
2021-11-05  4:21             ` Liu, Changpeng
2021-11-05  4:38               ` Li Feng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210903075637.2201185-1-fengli@smartx.com \
    --to=fengli@smartx.com \
    --cc=chenbo.xia@intel.com \
    --cc=dev@dpdk.org \
    --cc=maxime.coquelin@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).