diff options
author | Haoqian He <haoqian.he@smartx.com> | 2024-04-26 07:09:46 -0400 |
---|---|---|
committer | Maxime Coquelin <maxime.coquelin@redhat.com> | 2024-06-07 15:52:12 +0200 |
commit | dbdbd52c79d1a8f4638ccd9f726ed79f5aa72240 (patch) | |
tree | bcbc8054a7bda72c39ad4025b9d2839f063d23ea | |
parent | a16f688e142d721b1f5fcc9ad43fa87c652b170d (diff) |
vhost: cleanup resubmit info before inflight setup
This patch fixes a potential VM hang bug when the VM reboots after
vhost live recovery due to missing cleanup virtqueue resubmit info.
Specifically, if inflight IO that should be resubmitted during
the latest vhost reconnection has not been submitted yet while
VM rebooting, so GET_VRING_BASE would not wait for the inflight
IO, at this time the resubmit info has been. When the VM restarts,
SET_VRING_KICK will resubmit the inflight IO (If resubmit info
is not null, function set_vring_kick will return without updating
resubmit info).
It’s an error, any stale inflight IO should not be resubmitted
after the VM restart.
The solution is to clean up virtqueue resubmit info when function
set_inflight_fd before function set_vring_kick.
Fixes: ad0a4ae491fe ("vhost: checkout resubmit inflight information")
Cc: stable@dpdk.org
Signed-off-by: Haoqian He <haoqian.he@smartx.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
-rw-r--r-- | .mailmap | 1 | ||||
-rw-r--r-- | lib/vhost/vhost_user.c | 1 |
2 files changed, 2 insertions, 0 deletions
@@ -495,6 +495,7 @@ Hanoch Haim <hhaim@cisco.com> Hanumanth Pothula <hpothula@marvell.com> Hao Chen <chenh@yusur.tech> <chenhao164@huawei.com> Hao Wu <hao.wu@intel.com> +Haoqian He <haoqian.he@smartx.com> Hari Kumar Vemula <hari.kumarx.vemula@intel.com> Harini Ramakrishnan <harini.ramakrishnan@microsoft.com> Hariprasad Govindharajan <hariprasad.govindharajan@intel.com> diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c index 414192500e..7c54afc5fb 100644 --- a/lib/vhost/vhost_user.c +++ b/lib/vhost/vhost_user.c @@ -1871,6 +1871,7 @@ vhost_user_set_inflight_fd(struct virtio_net **pdev, if (!vq) continue; + cleanup_vq_inflight(dev, vq); if (vq_is_packed(dev)) { vq->inflight_packed = addr; vq->inflight_packed->desc_num = queue_size; |