From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2F60544086; Tue, 21 May 2024 10:55:57 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A91BA40265; Tue, 21 May 2024 10:55:56 +0200 (CEST) Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by mails.dpdk.org (Postfix) with ESMTP id 55AC14021E for ; Tue, 21 May 2024 10:55:55 +0200 (CEST) Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-1f304533064so11192215ad.0 for ; Tue, 21 May 2024 01:55:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smartx-com.20230601.gappssmtp.com; s=20230601; t=1716281754; x=1716886554; darn=dpdk.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=K3JEZArUYHFcxIVv7u1YhI6lRiSyO2bdYzGszhqyEsc=; b=kR1uTsAciXrOIU3NwoUWoyXdcnrBPGowbf6P+gVu1aBEJmr/XzxX6fQhjfcowXg49t RwzoqS3hXu/2c/SqqgT3i6S5GuU0eHPqp7SRQPGwfJXA92qaTewU9dlVEofkZax5ybmU efIUktCOE4MrjeJQUxTkrshkGCfI62rqj0XcOML8X9W6lc7MIsJqyw7rimRjfoB36GYF BlybA6D9qxaUKFAiaVeQbykkrIBaxXguah9gtDjsecGwM71YyRJ1kHEYvUKTilx0bU4l iVFbxKQXxabhifTFtG5aaC32JOivO49d48hbsK8/aW2Dq6PODhUiLARiDpHfez5jrYUZ TwFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716281754; x=1716886554; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=K3JEZArUYHFcxIVv7u1YhI6lRiSyO2bdYzGszhqyEsc=; b=CGyfAdizakaPxxG92jeB6erJucHSCHuReBmWJs8yoCI9kXxkcYCXh1D2IxjseDiqAN ieWay2pbpNYHKTwWOoAKKDqcQGrbl4IOv9mdvbbKWuTv2ENWdgvP0q3ik1dyaATYvBvf oHcpN8VR7MCvck2VQYf9S53850uG3iDwWZPTrS5Hj0eNlVvK0jCJ+15fz+cEbMiNhtz9 1o+WqfdWJm8fmX+IbNtuQLzyEwVq5K4LofBAxXIUzpPjnv4nCdaLbmz//iAzlCDVQ1Jc VF5Pa0G8pMe0WJMdS65qnaTx7svM2cM72URPJa5xCcqPbM7RJI645MebC/LomImmEeah R1kg== X-Forwarded-Encrypted: i=1; AJvYcCWNIEAW21Nr7d9mbBOoqM+/m5KnpaZ7Qo2vTwfSwVf3mF3JAqahzISGawHtTBSyysvasu8Vs4OSxZ/vDG0= X-Gm-Message-State: AOJu0YytL2SrISnIOVEcxzl4oBu/QGUE0MFBVS5jc8PFhoMT4F+Q1HYB p4hknVOdpA8CeesvsRu1WUEm/50CbVdV5bS4prXhkkC86fTD3+D1/w319Exd/Xs= X-Google-Smtp-Source: AGHT+IF71cg4LDDoneYiNuqEpAUxvpUCnFFynCjW7NBYueZi332kRu9spJqz8fwWol7YsaU/CzXIWg== X-Received: by 2002:a17:902:d2c9:b0:1f2:f6e7:290d with SMTP id d9443c01a7336-1f2f6e729e7mr101915505ad.10.1716281754185; Tue, 21 May 2024 01:55:54 -0700 (PDT) Received: from smtpclient.apple ([103.172.41.201]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1ef0c134155sm217100465ad.231.2024.05.21.01.55.51 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 May 2024 01:55:53 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.500.231\)) Subject: Re: [PATCH v2] vhost: cleanup resubmit info before inflight setup From: Haoqian He In-Reply-To: <20240426110947.881407-1-haoqian.he@smartx.com> Date: Tue, 21 May 2024 16:55:36 +0800 Cc: Li Feng Content-Transfer-Encoding: quoted-printable Message-Id: <1E677BA9-B4C2-4905-8742-B46CC1C50FAA@smartx.com> References: <8a04f203-4ef0-4840-b480-b21e08561c7d@redhat.com> <20240426110947.881407-1-haoqian.he@smartx.com> To: Maxime Coquelin , Chenbo Xia , dev@dpdk.org X-Mailer: Apple Mail (2.3731.500.231) X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org > 2024=E5=B9=B44=E6=9C=8826=E6=97=A5 19:09=EF=BC=8CHaoqian He = =E5=86=99=E9=81=93=EF=BC=9A >=20 > This patch fixes a potential VM hang bug when the VM reboots after > vhost live recovery due to missing cleanup virtqueue resubmit info. >=20 > 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). >=20 > It=E2=80=99s an error, any stale inflight IO should not be resubmitted > after the VM restart. >=20 > The solution is to clean up virtqueue resubmit info when function > set_inflight_fd before function set_vring_kick. >=20 > Fixes: ad0a4ae491fe ("vhost: checkout resubmit inflight information") > Cc: stable@dpdk.org >=20 > Signed-off-by: Haoqian He > --- > v2: rewrite the commit message. >=20 > lib/vhost/vhost_user.c | 1 + > 1 file changed, 1 insertion(+) >=20 > 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; >=20 > + cleanup_vq_inflight(dev, vq); > if (vq_is_packed(dev)) { > vq->inflight_packed =3D addr; > vq->inflight_packed->desc_num =3D queue_size; > --=20 > 2.44.0 >=20 Ping. Hi Maxime and Chenbo, Do u have any suggestions for this patch? Looking forward to hearing from u! Thanks, Haoqian=