DPDK patches and discussions
 help / color / mirror / Atom feed
From: Haoqian He <haoqian.he@smartx.com>
To: dev@dpdk.org, Maxime Coquelin <maxime.coquelin@redhat.com>
Cc: Chenbo Xia <chenbox@nvidia.com>, Li Feng <fengli@smartx.com>
Subject: Re: [PATCH] vhost: cleanup vq resubmit info when set_inflight_fd
Date: Fri, 12 Apr 2024 16:10:13 +0800	[thread overview]
Message-ID: <0884BFE3-D739-4E61-BB0F-109959A1F88E@smartx.com> (raw)
In-Reply-To: <20240321095805.923117-1-haoqian.he@smartx.com>

[-- Attachment #1: Type: text/plain, Size: 1815 bytes --]



> 2024年3月21日 17:57,Haoqian He <haoqian.he@smartx.com> 写道:
> 
> We should cleanup vq resubmit info when set_inflight_fd
> before set_vring_kick which will check if there is any
> inflight io waiting for resubmission.
> 
> Otherwise, when the vm is rebooting immediately after
> reconnecting to the vhost target (inflight io has not
> been resubmitted yet), the vhost backend still use the
> old resubmit info set when reconnection.
> 
> Signed-off-by: Haoqian He <haoqian.he@smartx.com>
> ---
> 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.41.0
> 

Ping.

Hi, Maxime.

This patch fix the potential error when VM reboot after vhost live recovery which
could lead to the VM hang as missing resubmit info cleanup.

If inflight io that should be resubmitted during the latest vhost reconnection has
not been submitted yet, so GET_VRING_BASE would not wait these inflight io,
at this time the resubmit info has been set and restart the VM immediately.

Currently, we do not cleanup the resubmit info before VM restart, so when VM
restarts, SET_VRING_KICK will resubmit these 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.

Thanks,
Haoqian



 



[-- Attachment #2: Type: text/html, Size: 3426 bytes --]

  parent reply	other threads:[~2024-04-12  8:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-21  9:57 Haoqian He
2024-04-03  5:08 ` Haoqian He
2024-04-12  8:10 ` Haoqian He [this message]
2024-04-25 13:12 ` Maxime Coquelin
2024-04-26 11:09   ` [PATCH v2] vhost: cleanup resubmit info before inflight setup Haoqian He
2024-04-26 21:28     ` Patrick Robb

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0884BFE3-D739-4E61-BB0F-109959A1F88E@smartx.com \
    --to=haoqian.he@smartx.com \
    --cc=chenbox@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=fengli@smartx.com \
    --cc=maxime.coquelin@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).