[PATCH] vhost: cleanup vq resubmit info when set_inflight_fd
Maxime Coquelin
maxime.coquelin at redhat.com
Wed Jun 12 10:30:06 CEST 2024
On 3/21/24 10:57, Haoqian He wrote:
> 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 at 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;
Applied to next-virtio/for-next-net.
Thanks,
Maxime
More information about the dev
mailing list