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 3FD6843F15 for ; Fri, 26 Apr 2024 13:10:09 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 39F9A43D7A; Fri, 26 Apr 2024 13:10:09 +0200 (CEST) Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) by mails.dpdk.org (Postfix) with ESMTP id C1A0A40289 for ; Fri, 26 Apr 2024 13:10:06 +0200 (CEST) Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-1e3e84a302eso15760095ad.0 for ; Fri, 26 Apr 2024 04:10:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smartx-com.20230601.gappssmtp.com; s=20230601; t=1714129806; x=1714734606; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GKTxmqew+rvCX5Zg7C+CU2vpNXsP12QqlfX5l5cK+VU=; b=Hqsu5N3uLfBAFPvJGIe/UlOaTHAo4sXxBkbBOrp2Dxu5kEMc7FLZy5yQMD8v6XsvA8 WhKYc7U2cATqs1tIjMeCwna4ocJ6uHSJyk0GIR9R0/7pGE7sdRbG1eb6iuyF6YRy7eF2 uzzopBarqUpi1EiYJrdgX6sqJ0+voxzpZ2swi4NjqsSuPAlFQDKHPK9M50unb29WslyV xuL4eJCSgpxYEY2x/9ZTWHzlmz+FcyxU7SBxs/GlppNsZNXVpgkG7pA7AHgd0tiEh8Vh 1OdIF4s7+ARM7Iol7RnjbUZDzwpW3bmGL9qbmfD+lCwzAtBNLK28FcPJOxpTc6n922Ag PrpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714129806; x=1714734606; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GKTxmqew+rvCX5Zg7C+CU2vpNXsP12QqlfX5l5cK+VU=; b=uaDXxdQSMqbt0PLhF0PaXS5Spv6Bk7kdAMNXK+0U08GaLopqenRRgrOCbo+76iBaQE LUNSDvkRDbxqNAA95qNAVzOAXDWlb02B9MJEAgMWQcgiKToHXGY9KbY5/gljo7kKheny CzQBMzxLbQNnsE7M260Azi4qWTLd47Vzh4wQHw6GPDil5iWWph2rpPXmDrGvExyH4vLJ 7w2RhC1l3Bh9V5E1jMOHRl084ou/V7DNusWvM5BDaSDUq1n2ysQTHo+c8Hq7Lcg94UGR 56t2FOGvsrWunEiGm4mWubDF2Mr1kSB9urOuuspPmQeuOV1JdmZhRPWD3ZWIDAC5C0Jt flCw== X-Forwarded-Encrypted: i=1; AJvYcCUSJh/w7gUnI/9DikDAeKwasPdxY/oIxa5vYzdpIrpZ6xXVFeQjRipCLgg4pKa1aMctHiFTd/mokravz349bJM= X-Gm-Message-State: AOJu0YzHAWuH+kr4lYNQiI2BlMPybckpJiXSPD/YvkpyWjlq3mGjhZLe sOZlKHmVRTwVm2zhOqfI2bD/CMeU7UBxYA1KMO0FXmdr2tpma+/krYc/xG2WEFs= X-Google-Smtp-Source: AGHT+IHn8xo7qifFlwHFNdgh5SZkP3sRCliS7sckA+RoXBIEj8OpUqE1L6CUzJVanSkduYunPzvjMA== X-Received: by 2002:a17:902:ef89:b0:1e1:214:1b7d with SMTP id iz9-20020a170902ef8900b001e102141b7dmr2073633plb.61.1714129804855; Fri, 26 Apr 2024 04:10:04 -0700 (PDT) Received: from fedora.smartx.com ([1.202.18.10]) by smtp.gmail.com with ESMTPSA id c7-20020a170903234700b001eb0dd08e40sm925467plh.133.2024.04.26.04.10.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 04:10:04 -0700 (PDT) From: Haoqian He To: maxime.coquelin@redhat.com Cc: chenbox@nvidia.com, dev@dpdk.org, haoqian.he@smartx.com, fengli@smartx.com, stable@dpdk.org Subject: [PATCH v2] vhost: cleanup resubmit info before inflight setup Date: Fri, 26 Apr 2024 07:09:46 -0400 Message-ID: <20240426110947.881407-1-haoqian.he@smartx.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <8a04f203-4ef0-4840-b480-b21e08561c7d@redhat.com> References: <8a04f203-4ef0-4840-b480-b21e08561c7d@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org 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 --- 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