patch 'vhost: cleanup resubmit info before inflight setup' has been queued to stable release 22.11.6

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue Jun 25 01:58:31 CEST 2024


Hi,

FYI, your patch has been queued to stable release 22.11.6

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/27/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/aff6953d46a68165eddc631154cb687e7f646cac

Thanks.

Luca Boccassi

---
>From aff6953d46a68165eddc631154cb687e7f646cac Mon Sep 17 00:00:00 2001
From: Haoqian He <haoqian.he at smartx.com>
Date: Fri, 26 Apr 2024 07:09:46 -0400
Subject: [PATCH] vhost: cleanup resubmit info before inflight setup
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit e4a01eea66326c58593906e189b376605a0ec606 ]

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")

Signed-off-by: Haoqian He <haoqian.he at smartx.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>
---
 .mailmap               | 1 +
 lib/vhost/vhost_user.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/.mailmap b/.mailmap
index 1c0d974460..2724a689fd 100644
--- a/.mailmap
+++ b/.mailmap
@@ -473,6 +473,7 @@ Hanoch Haim <hhaim at cisco.com>
 Hanumanth Pothula <hpothula at marvell.com>
 Hao Chen <chenhao164 at huawei.com>
 Hao Wu <hao.wu at intel.com>
+Haoqian He <haoqian.he at smartx.com>
 Hari Kumar Vemula <hari.kumarx.vemula at intel.com>
 Harini Ramakrishnan <harini.ramakrishnan at microsoft.com>
 Hariprasad Govindharajan <hariprasad.govindharajan at intel.com>
diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c
index 66ab68fa56..8d7d04059c 100644
--- a/lib/vhost/vhost_user.c
+++ b/lib/vhost/vhost_user.c
@@ -1745,6 +1745,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;
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:16.241753554 +0100
+++ 0045-vhost-cleanup-resubmit-info-before-inflight-setup.patch	2024-06-25 00:22:13.173185404 +0100
@@ -1 +1 @@
-From e4a01eea66326c58593906e189b376605a0ec606 Mon Sep 17 00:00:00 2001
+From aff6953d46a68165eddc631154cb687e7f646cac Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit e4a01eea66326c58593906e189b376605a0ec606 ]
+
@@ -27 +28,0 @@
-Cc: stable at dpdk.org
@@ -37 +38 @@
-index ed63605a15..ff20619bfb 100644
+index 1c0d974460..2724a689fd 100644
@@ -40 +41 @@
-@@ -495,6 +495,7 @@ Hanoch Haim <hhaim at cisco.com>
+@@ -473,6 +473,7 @@ Hanoch Haim <hhaim at cisco.com>
@@ -42 +43 @@
- Hao Chen <chenh at yusur.tech> <chenhao164 at huawei.com>
+ Hao Chen <chenhao164 at huawei.com>
@@ -49 +50 @@
-index 414192500e..7c54afc5fb 100644
+index 66ab68fa56..8d7d04059c 100644
@@ -52 +53 @@
-@@ -1871,6 +1871,7 @@ vhost_user_set_inflight_fd(struct virtio_net **pdev,
+@@ -1745,6 +1745,7 @@ vhost_user_set_inflight_fd(struct virtio_net **pdev,


More information about the stable mailing list