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

Kevin Traynor ktraynor at redhat.com
Fri Aug 23 18:17:43 CEST 2024


Hi,

FYI, your patch has been queued to stable release 21.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/28/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/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/1a7bda79d140d77a097558cf29d63eda14c66f7f

Thanks.

Kevin

---
>From 1a7bda79d140d77a097558cf29d63eda14c66f7f 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 41d1bdb972..7aaed03aab 100644
--- a/.mailmap
+++ b/.mailmap
@@ -472,4 +472,5 @@ Hanumanth Pothula <hpothula at marvell.com>
 Hao Chen <chenh at yusur.tech> <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>
diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c
index af0062dd1f..ca0618f627 100644
--- a/lib/vhost/vhost_user.c
+++ b/lib/vhost/vhost_user.c
@@ -1787,4 +1787,5 @@ vhost_user_set_inflight_fd(struct virtio_net **pdev, VhostUserMsg *msg,
 			continue;
 
+		cleanup_vq_inflight(dev, vq);
 		if (vq_is_packed(dev)) {
 			vq->inflight_packed = addr;
-- 
2.46.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-08-23 17:18:10.997338861 +0100
+++ 0035-vhost-cleanup-resubmit-info-before-inflight-setup.patch	2024-08-23 17:18:09.674429945 +0100
@@ -1 +1 @@
-From e4a01eea66326c58593906e189b376605a0ec606 Mon Sep 17 00:00:00 2001
+From 1a7bda79d140d77a097558cf29d63eda14c66f7f 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 41d1bdb972..7aaed03aab 100644
@@ -40 +41 @@
-@@ -496,4 +496,5 @@ Hanumanth Pothula <hpothula at marvell.com>
+@@ -472,4 +472,5 @@ Hanumanth Pothula <hpothula at marvell.com>
@@ -47 +48 @@
-index 414192500e..7c54afc5fb 100644
+index af0062dd1f..ca0618f627 100644
@@ -50 +51 @@
-@@ -1872,4 +1872,5 @@ vhost_user_set_inflight_fd(struct virtio_net **pdev,
+@@ -1787,4 +1787,5 @@ vhost_user_set_inflight_fd(struct virtio_net **pdev, VhostUserMsg *msg,



More information about the stable mailing list