* [PATCH v2] vhost: cleanup resubmit info before inflight setup
[not found] <8a04f203-4ef0-4840-b480-b21e08561c7d@redhat.com>
@ 2024-04-26 11:09 ` Haoqian He
2024-04-26 21:28 ` Patrick Robb
2024-06-07 13:50 ` Maxime Coquelin
0 siblings, 2 replies; 3+ messages in thread
From: Haoqian He @ 2024-04-26 11:09 UTC (permalink / raw)
To: maxime.coquelin; +Cc: chenbox, dev, haoqian.he, fengli, stable
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(+)
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;
--
2.44.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] vhost: cleanup resubmit info before inflight setup
2024-04-26 11:09 ` [PATCH v2] vhost: cleanup resubmit info before inflight setup Haoqian He
@ 2024-04-26 21:28 ` Patrick Robb
2024-06-07 13:50 ` Maxime Coquelin
1 sibling, 0 replies; 3+ messages in thread
From: Patrick Robb @ 2024-04-26 21:28 UTC (permalink / raw)
To: Haoqian He; +Cc: maxime.coquelin, chenbox, dev, fengli, stable
[-- Attachment #1: Type: text/plain, Size: 296 bytes --]
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.
[-- Attachment #2: Type: text/html, Size: 361 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] vhost: cleanup resubmit info before inflight setup
2024-04-26 11:09 ` [PATCH v2] vhost: cleanup resubmit info before inflight setup Haoqian He
2024-04-26 21:28 ` Patrick Robb
@ 2024-06-07 13:50 ` Maxime Coquelin
1 sibling, 0 replies; 3+ messages in thread
From: Maxime Coquelin @ 2024-06-07 13:50 UTC (permalink / raw)
To: Haoqian He; +Cc: chenbox, dev, fengli, stable
On 4/26/24 13:09, Haoqian He wrote:
> 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(+)
>
> 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;
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Thanks,
Maxime
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-06-07 13:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <8a04f203-4ef0-4840-b480-b21e08561c7d@redhat.com>
2024-04-26 11:09 ` [PATCH v2] vhost: cleanup resubmit info before inflight setup Haoqian He
2024-04-26 21:28 ` Patrick Robb
2024-06-07 13:50 ` Maxime Coquelin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).