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 59B4EA0543 for ; Tue, 21 Jun 2022 10:06:00 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 55CCE4280E; Tue, 21 Jun 2022 10:06:00 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2081.outbound.protection.outlook.com [40.107.236.81]) by mails.dpdk.org (Postfix) with ESMTP id 69D274281C for ; Tue, 21 Jun 2022 10:05:58 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fg1rGjF4kfwhe+hVvNXYaSg2PYRLX9ArFjuFj72u8o4j72FSXPczheG1rrH5CSXmsDw3yGoGkUSPykHQTzv6TfRIN+aqSxWFBv57xrygkJppn8dEqvKyVtEzvcxF//Q0YBepegY/hE8YwtjVrv5au+i9RhxdN+LMsNv+d8cal0N71QKXttcsasv/794MtDZMCRMvdCagtclsukhXMOUHeefXYZ3m4lcRMx4imK4s+3v2ZWygZX+aDrxyeJghUXpsKrSWFMaQn0oZZ4shvaoV2xvv+5vixnrRf/grL+hsWWUJ5EysNU2u/kIifxllHe15j6tnl1k02Ma4hmIuiSkkRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=bOnf1n7RD4DR007GbTp89nq5IQhSaw06rSWUb4N7omE=; b=ZeT9xrD+zfcrngvE9NMn7IA2wYTFVasv88wZBHtex30nmRqK8UMlHhAOo2yJbH9SPkFwslhBZvOy2Em8TZPk50olE4uIpR9e2VkTnNH9H1n+agXSLikaJCPMF/W6S7QB8PL61byEiSxJsfMjMr9NTf66M275dBOYRtsAZ9EHidPpU8u3cEDswhZY7ofHnfxebcRhbQtgn9DFha1fwsAtSL98Mk7fwcZWg8boLlPy88LBiQbyF/QcN1JaXokDCywbltNLY2hYO8AGK0ymGSnbjWXMzp5ExZdnfHW7ma5MJGoIYtWFWscS2Ze2plh8gcSD6O82PiuzEmCMyzafah/Rcg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.236) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bOnf1n7RD4DR007GbTp89nq5IQhSaw06rSWUb4N7omE=; b=iFULLruWR5ypGK6xf4eR4/QEbbn36egNp5CD2VBqICuuAeYrE9HQfH3LEdRGxyedo/wn/pdnp5ns8tPFUkO48hSPpWfEq3vpfFEOSZI1oHkw6zsMGsqyRYHOezfMufsGvGH434SUhdneVy8HdhktBHLLbposyY4Nn++pSFGRaSDQpXN30WSDod2zt0vFI5rJ6XpOi/3dRnw+xjRA0fMZnD9vC+ZXllvf5wekLtUe9FO7u7/xsRd4A8DibE//WpPirScx6p1SWQiXFPeBLf3eVuSOKLpahCIDgQyE1Bh7HxlaPcgVIG9Utykwfqix6W7bdvhXJ0oO9qP1Q+rgkBq2tg== Received: from DS7PR05CA0088.namprd05.prod.outlook.com (2603:10b6:8:56::14) by BN6PR12MB1186.namprd12.prod.outlook.com (2603:10b6:404:1c::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.14; Tue, 21 Jun 2022 08:05:56 +0000 Received: from DM6NAM11FT057.eop-nam11.prod.protection.outlook.com (2603:10b6:8:56:cafe::b3) by DS7PR05CA0088.outlook.office365.com (2603:10b6:8:56::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.9 via Frontend Transport; Tue, 21 Jun 2022 08:05:56 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.236) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.236 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.236; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.236) by DM6NAM11FT057.mail.protection.outlook.com (10.13.172.252) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5353.14 via Frontend Transport; Tue, 21 Jun 2022 08:05:56 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL109.nvidia.com (10.27.9.19) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Tue, 21 Jun 2022 08:05:55 +0000 Received: from nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Tue, 21 Jun 2022 01:05:54 -0700 From: Xueming Li To: Xueming Li CC: Maxime Coquelin , dpdk stable Subject: patch 'vdpa/mlx5: fix dead loop when process interrupted' has been queued to stable release 20.11.6 Date: Tue, 21 Jun 2022 11:01:38 +0300 Message-ID: <20220621080301.2315720-33-xuemingl@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220621080301.2315720-1-xuemingl@nvidia.com> References: <20220621080301.2315720-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: deb859df-ab29-4dd5-d00b-08da535cdecb X-MS-TrafficTypeDiagnostic: BN6PR12MB1186:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KOECyr1MBdjDcl2GX9xLdff+tb0jWkDr0kB0hCd6FscPMGThWPYlHKhHo8snsV2DRWVpfUO8NRbSZrnj/YzqkaYOiUohdgjGMWmQN6QxpWAcUqveZHlYUnxQ3kY6NZTlaB4mz2eORzAtbeOUur40W24th8YwJZf3kL0N2Fc3tudv7Wn1Oa1Rh+TT49W1sCv9zOSUKhk0XPtdwEuiii5suojDxLluivTTfQogmUrFUtiWSNj2gzc07iZqrQVUyplt7JCg6OO/37FnFdp8l/yMxJpkglewcpVtxGejIE76fciplT4Mb2lDKVwgiH5vOQYT2YGvXk6aeCZVLlB2Jmi8Y3RNOQJtpArgLELMxcOvQVIR2MbnlWFIIbSpHHO9v98ru10mPFhSbif0LOYTjCaG698iqOXPo2JtFtoA2HNNN5Vxrn84gA37jP5k3DbZqkBB6yZ0Za54Ve3Fb8vYZKfIHXh4rfFZtGLQhcbXufVkRFQ2Y//QQuBydrmvapwD0213Y/YAfO7fzRFCYUiLe8ZRXP7qI8mNdjO/YBrbK+6opMxoYt918BvIwo+OUIQ+9psRQRW2G9DtZyo2q6s3TReNc3muff7UW7vwLdmSxd6dDu8YogHabBUCNeVYEpMyI321Ai8MAEbY8WkG8PwJoGA3NkYVLu1z76/VQQpr+ZB4nfKO1U4LdshOe/BNF0+dGY8hT5GVhZlGDdvkCsLEqkKq6TE0ZZB7AbhWv22NaRjRMSAdyoIyAef3jVZOdAntD+ZtVnRnEFrwAC1xhbCTaloe5F65pkOdpiCtqs0gQdDeK/mMkWm1YIMyqhK7N55JxmvYwbAo4mkFZcPHHNneBxUnJLUinjsMSpqartYiZe78u8Q= X-Forefront-Antispam-Report: CIP:12.22.5.236; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230016)(4636009)(376002)(346002)(136003)(39860400002)(396003)(46966006)(40470700004)(36840700001)(53546011)(7696005)(5660300002)(16526019)(6862004)(26005)(966005)(41300700001)(2906002)(8936002)(86362001)(478600001)(6286002)(316002)(7049001)(54906003)(81166007)(2616005)(6666004)(37006003)(36860700001)(70206006)(1076003)(8676002)(4326008)(82740400003)(356005)(70586007)(6200100001)(426003)(336012)(55016003)(47076005)(186003)(83380400001)(82310400005)(40460700003)(36756003)(40480700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2022 08:05:56.5092 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: deb859df-ab29-4dd5-d00b-08da535cdecb X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.236]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT057.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1186 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 Hi, FYI, your patch has been queued to stable release 20.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/23/22. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/6111eb8b88a84f181d9c70e5de22a82df355d2f1 Thanks. Xueming Li --- >From 6111eb8b88a84f181d9c70e5de22a82df355d2f1 Mon Sep 17 00:00:00 2001 From: Xueming Li Date: Sun, 8 May 2022 17:25:49 +0300 Subject: [PATCH] vdpa/mlx5: fix dead loop when process interrupted Cc: Xueming Li [ upstream commit 301ef4a18586ae1763206d7e75d9eddb58a7d05e ] In Ctrl+C handling, sometimes kick handling thread gets endless EGAIN error and fall into dead lock. Kick happens frequently in real system due to busy traffic or retry mechanism. This patch simplifies kick firmware anyway and skip setting hardware notifier due to potential device error, notifier could be set in next successful kick request. Fixes: 62c813706e41 ("vdpa/mlx5: map doorbell") Signed-off-by: Xueming Li Reviewed-by: Maxime Coquelin --- drivers/vdpa/mlx5/mlx5_vdpa_virtq.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c b/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c index c8c615054a..0d31e1d957 100644 --- a/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c +++ b/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c @@ -23,8 +23,9 @@ mlx5_vdpa_virtq_kick_handler(void *cb_arg) struct mlx5_vdpa_priv *priv = virtq->priv; uint64_t buf; int nbytes; + int retry; - do { + for (retry = 0; retry < 3; ++retry) { nbytes = read(virtq->intr_handle.fd, &buf, 8); if (nbytes < 0) { if (errno == EINTR || @@ -35,7 +36,9 @@ mlx5_vdpa_virtq_kick_handler(void *cb_arg) virtq->index, strerror(errno)); } break; - } while (1); + } + if (nbytes < 0) + return; rte_write32(virtq->index, priv->virtq_db_addr); if (virtq->notifier_state == MLX5_VDPA_NOTIFIER_STATE_DISABLED) { if (rte_vhost_host_notifier_ctrl(priv->vid, virtq->index, true)) -- 2.35.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-06-21 15:37:50.782973610 +0800 +++ 0032-vdpa-mlx5-fix-dead-loop-when-process-interrupted.patch 2022-06-21 15:37:49.007784479 +0800 @@ -1 +1 @@ -From 301ef4a18586ae1763206d7e75d9eddb58a7d05e Mon Sep 17 00:00:00 2001 +From 6111eb8b88a84f181d9c70e5de22a82df355d2f1 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 301ef4a18586ae1763206d7e75d9eddb58a7d05e ] @@ -15 +17,0 @@ -Cc: stable@dpdk.org @@ -20,2 +22,2 @@ - drivers/vdpa/mlx5/mlx5_vdpa_virtq.c | 8 +++++--- - 1 file changed, 5 insertions(+), 3 deletions(-) + drivers/vdpa/mlx5/mlx5_vdpa_virtq.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) @@ -24 +26 @@ -index 2e517beda2..2696d54b41 100644 +index c8c615054a..0d31e1d957 100644 @@ -27 +29 @@ -@@ -23,11 +23,11 @@ mlx5_vdpa_virtq_kick_handler(void *cb_arg) +@@ -23,8 +23,9 @@ mlx5_vdpa_virtq_kick_handler(void *cb_arg) @@ -33,3 +34,0 @@ - if (rte_intr_fd_get(virtq->intr_handle) < 0) - return; -- @@ -38,2 +37 @@ - nbytes = read(rte_intr_fd_get(virtq->intr_handle), &buf, - 8); + nbytes = read(virtq->intr_handle.fd, &buf, 8); @@ -41 +39,2 @@ -@@ -39,7 +39,9 @@ mlx5_vdpa_virtq_kick_handler(void *cb_arg) + if (errno == EINTR || +@@ -35,7 +36,9 @@ mlx5_vdpa_virtq_kick_handler(void *cb_arg)