[v2] vhost: cleanup resubmit info before inflight setup

Message ID 20240426110947.881407-1-haoqian.he@smartx.com (mailing list archive)
State New
Delegated to: Maxime Coquelin
Headers
Series [v2] vhost: cleanup resubmit info before inflight setup |

Checks

Context Check Description
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-unit-amd64-testing fail Testing issues
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS

Commit Message

Haoqian He April 26, 2024, 11:09 a.m. UTC
  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>
---
v2: rewrite the commit message.

 lib/vhost/vhost_user.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Patrick Robb April 26, 2024, 9:28 p.m. UTC | #1
Recheck-request: iol-compile-amd64-testing

The DPDK Community Lab updated to the latest Alpine image yesterday, which
resulted in all Alpine builds failing. The failure is unrelated to your
patch, and this recheck should remove the fail on Patchwork, as we have
disabled Alpine testing for now.
  

Patch

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;