[v2] vhost: cleanup resubmit info before inflight setup
Checks
Commit Message
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
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.
@@ -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;