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 1A0A543D14; Thu, 21 Mar 2024 11:06:53 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 92EAC42D80; Thu, 21 Mar 2024 11:06:45 +0100 (CET) Received: from mail-ua1-f52.google.com (mail-ua1-f52.google.com [209.85.222.52]) by mails.dpdk.org (Postfix) with ESMTP id 9891F42D2A for ; Thu, 21 Mar 2024 11:06:42 +0100 (CET) Received: by mail-ua1-f52.google.com with SMTP id a1e0cc1a2514c-7e070b9736bso1041143241.0 for ; Thu, 21 Mar 2024 03:06:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smartx-com.20230601.gappssmtp.com; s=20230601; t=1711015601; x=1711620401; darn=dpdk.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=zLIN/6JFkcUaBcglXnLMXBzLQ4Bo7nEdk7oEaubu0AI=; b=S7hkUVzMcjUjUiVZA8bsCxnLE+jQKkcI07YDdIk9kgCxGGmjJ7eqvs+PzTB0JTsntW veej3D6qpbxaBj4vwp/zayFXkuHL9mQNnC+tb08/61oexHu6Fc5aSBvZMKIT6J02sErA KHc2xT5WGYXW/xI5DboH4G5LNnF0uoJpK1bT9szkp9oz3mmrHl8OUmltE7jRyjA+Kgk1 MD8O6o2xLyAWayl1GR+H5723nz0Ma+/1ADtfGs907WujDqoN60s8wo2lAP2JS0/Pjizq cUSOzSQA7ZkXGCxuDxqpybFjRwlobVOVTThuthQBjr/fybggTomrZUdwd21fRJN/LwP6 TBXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711015601; x=1711620401; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zLIN/6JFkcUaBcglXnLMXBzLQ4Bo7nEdk7oEaubu0AI=; b=hPbga9w7ZRO2oq4SD7nDqBDo28nTEG7kJ13hVIdHl+0ae1cZpjaNSEsvgVqMOkDGdS /jra0cLMRvrjzlAjpMiAJe/AgNukf5GVX5VeR3H4bo1LURxZJXiOvxoR9FVVULah/Wxb rHgxjYyTgCEOy+FHTYYcK/hMOvBWnF+p7No42X96eDXP0PkPQYXlvJ6A6SlFsw1ylTc2 57KX0UGKj3mLrXlHCDZE1uw5D/t4FxlQPcZdwiensQ1w1+0/camshKOpn6di2BYTvMl0 Ma2AoNJtKPiwQyvBRdj9ZDrBZrD/9j4MBdc+YAF6n3oi04VWAIQaLnB0MvnXqNjB+rdl 7HxQ== X-Gm-Message-State: AOJu0Yxbqy4zhGc+n9GpTKdKCfIDS9lGhBGNXX5sdmakVUU7+KamwnJT qr8yQlPKjurEDmtFGFdvea4DCQNgtEBotqdI20PL3ls4bGKfnT18CPdkF5bm9WP5T2WJrrp7Lkt zNFA= X-Google-Smtp-Source: AGHT+IH5GBLC+NgsvS/Pjbg9mGeyByL+iCVRXtEepi1NArkLfZTWqdT+GfclcYXwxzUUmtvugnhruQ== X-Received: by 2002:a05:6a20:734e:b0:1a3:5288:e16 with SMTP id v14-20020a056a20734e00b001a352880e16mr3386121pzc.11.1711015115393; Thu, 21 Mar 2024 02:58:35 -0700 (PDT) Received: from fedora.smartx.com ([1.202.18.10]) by smtp.gmail.com with ESMTPSA id x16-20020aa784d0000000b006e66c9bb00dsm13409774pfn.179.2024.03.21.02.58.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 02:58:35 -0700 (PDT) From: Haoqian He To: dev@dpdk.org Cc: Maxime Coquelin , Chenbo Xia Subject: [PATCH] vhost: cleanup vq resubmit info when set_inflight_fd Date: Thu, 21 Mar 2024 05:57:53 -0400 Message-ID: <20240321095805.923117-1-haoqian.he@smartx.com> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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 --- 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