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 78CDE45E41 for ; Sat, 7 Dec 2024 09:09:26 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 710DF40281; Sat, 7 Dec 2024 09:09:26 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2089.outbound.protection.outlook.com [40.107.244.89]) by mails.dpdk.org (Postfix) with ESMTP id 78BC740281 for ; Sat, 7 Dec 2024 09:09:25 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=RbkNI3vnDGOJZ6HFWFClAjTF7Ur1Xv0U4W9nQtC7RallJI+tisfgZRRKJFD2iVV0kTiIWVqLzYCkZPjybTADqSyhOov5BWMNBC5WZaLjTMY3H1/+V5pVmnDBUTtr9n+YsNh+tNbwR+olajM0VMzzUPJwBwY9J7lTakL4GSIf1gJTgMvcFfHM6I9/KLTJZk/feLfGD+oYuTvaO4M5ki1uOfs6StHSLk0VsDGY7fj5ENofWtfLe6JzVoQu2k+i5p5AhbEKjvEi72DQ0wGcMiKUBcH3fH9qzktPfRanPA5jVbVzNJh385MqtrbSpxtpED+9e95ybzckDfyttLGFGCXyOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=E74RxRUep0AGnqYsLgwJX+WWnzJFFJJJhl2CsAHug+Q=; b=ly3bknikZ0D3vv+ux49ZXBxMt5L0nh2nuvHQjBX/QytRY8hZYXQyEAb0OorMRt9r0Xo6FGVxfYLRtRhAvrrrgzuG3HpXrodsesm3LuM8WPvzQHtPs4mPLhhd39xy4i7RmRM9WKrypeEArzqyp39Zf6qT1+LAw11giHv7jCOTakh6+9G8OzmjwMpQfUWW2u5TtbCyHLePTVyzKclcZjIhm9gK3iaf6arpwoU0IG2gpUHfL98dlxb7CCES7KR85vdnQQXGIkDDA7Li+2F8hpndvLVhjMG89d2uoNUchw78HXz6Q222pcvIbwuEC5+z88V+7nsoj3d970+jB0CrBkOdpA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=networkplumber.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 (0) 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=E74RxRUep0AGnqYsLgwJX+WWnzJFFJJJhl2CsAHug+Q=; b=rGCHhmX7SyFejNJzPA4L0wUc1Q7hAzOKQ/AawUL7Km1PT5WcLoT0FnYE1ScQzuo8YkUReUiFYgiyOtDtGwJulN5pf95gQ70Ds68d77Vig+E4jwVcPvt2zbHhNtTJ6nUWH26BhAz5tZvxbV4U+9kYZelUtdG5Hhj+X3h0s5hAunAF7MAxQExCqgeZ+JVY8UyPit4+vD/s+Mxv+5ywMuF610HULHHeVcGecaTdFvciFi9p/aRBl9CU6DzNPteHIHciJQeH+EPZZpQ/RfxP9izWSt16pW5PkJepcvD36l4Us3kzcKIcL87IMCDo+SWY/MBvqE96QSsTjtLc7xCRDCjT+Q== Received: from BLAPR03CA0014.namprd03.prod.outlook.com (2603:10b6:208:32b::19) by CY8PR12MB8196.namprd12.prod.outlook.com (2603:10b6:930:78::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8207.26; Sat, 7 Dec 2024 08:09:21 +0000 Received: from BL02EPF00021F68.namprd02.prod.outlook.com (2603:10b6:208:32b:cafe::ad) by BLAPR03CA0014.outlook.office365.com (2603:10b6:208:32b::19) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8230.10 via Frontend Transport; Sat, 7 Dec 2024 08:09:21 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BL02EPF00021F68.mail.protection.outlook.com (10.167.249.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.7 via Frontend Transport; Sat, 7 Dec 2024 08:09:20 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sat, 7 Dec 2024 00:09:15 -0800 Received: from nvidia.com (10.126.231.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.1544.4; Sat, 7 Dec 2024 00:09:13 -0800 From: Xueming Li To: Stephen Hemminger CC: Xueming Li , Maxime Coquelin , dpdk stable Subject: patch 'vhost: fix deadlock in Rx async path' has been queued to stable release 23.11.3 Date: Sat, 7 Dec 2024 16:00:43 +0800 Message-ID: <20241207080055.488538-86-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241207080055.488538-1-xuemingl@nvidia.com> References: <20241111062847.216344-122-xuemingl@nvidia.com> <20241207080055.488538-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF00021F68:EE_|CY8PR12MB8196:EE_ X-MS-Office365-Filtering-Correlation-Id: 1f403cf9-6c26-45fa-c5c6-08dd16967468 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|36860700013|376014|82310400026|7053199007; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?2KqCAW6fEytXVk/ZNPufJkO+Y6GecYOo6JQKpvMc8Urh61ys6uyeqBcB7PXv?= =?us-ascii?Q?vwdpOr08ITUcToAwNknEt+p0i9llVRpCX4cnCrfRpjkHnT1148Ihl0cr+d8Y?= =?us-ascii?Q?yITV23gywwJECSCHioc8/DYNoaHSoE4RLllPHHZdlpA5rXjGgB/7twbneEHP?= =?us-ascii?Q?OdhtQrUY8jnza/Cyp8uykn5hU9r2pqKV8pwXf8QwucZAHfxzQqequWyroepX?= =?us-ascii?Q?4sEN9r4KvOa2ixCg7uMnaewj/c7gP2ixV7/3FuZw6f6WggoBJuGv5V0srnYP?= =?us-ascii?Q?xs66tYy2MUhYq9osh07kp/sSS5FiB19f2L4u/wsfraeF7Iz8B4sG4yWwdjn5?= =?us-ascii?Q?cGSviw0gxyxIuNr/QzgDVAraibXRZzQVEWDQrNTmg+sH6Tf0GVe5dqFjDvn7?= =?us-ascii?Q?iBjk9eqSP7bdq8PUri+d0S0XEcvOAzwqY8QOK8GNy8sy5ZoITiKjh9WHHGtc?= =?us-ascii?Q?P06/BD1Ld39TfaehzCWU6PnryDtQJVtX5j9oAXiN9jFBD7UueyOF157ChmPl?= =?us-ascii?Q?sPwJtrslHfdb2At8Tx9Dm98UxChpSgyIJynaXRkZS0fKsae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+hZ7DQzxoDq77voJxUYEAWt39FopYz?= X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230040)(1800799024)(36860700013)(376014)(82310400026)(7053199007); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2024 08:09:20.8532 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1f403cf9-6c26-45fa-c5c6-08dd16967468 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF00021F68.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB8196 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 23.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/10/24. 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://git.dpdk.org/dpdk-stable/log/?h=23.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=37f8c86e53d081589faa324c6d6b034e1752014e Thanks. Xueming Li --- >From 37f8c86e53d081589faa324c6d6b034e1752014e Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 18 Nov 2024 08:24:24 -0800 Subject: [PATCH] vhost: fix deadlock in Rx async path Cc: Xueming Li [ upstream commit 22aa9a9c7099e1f4b297899c33b4fea1131d3ac7 ] If lock is acquired for write, it must be released for write or a deadlock is likely. Bugzilla ID: 1582 Fixes: 9fc93a1e2320 ("vhost: fix virtqueue access check in datapath") Signed-off-by: Stephen Hemminger Reviewed-by: Maxime Coquelin --- lib/vhost/virtio_net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c index 6d53ff932d..5ec89719c6 100644 --- a/lib/vhost/virtio_net.c +++ b/lib/vhost/virtio_net.c @@ -2546,7 +2546,7 @@ virtio_dev_rx_async_submit(struct virtio_net *dev, struct vhost_virtqueue *vq, if (unlikely(!vq->access_ok)) { vhost_user_iotlb_rd_unlock(vq); - rte_rwlock_read_unlock(&vq->access_lock); + rte_rwlock_write_unlock(&vq->access_lock); virtio_dev_vring_translate(dev, vq); goto out_no_unlock; -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-12-06 23:26:46.932850606 +0800 +++ 0085-vhost-fix-deadlock-in-Rx-async-path.patch 2024-12-06 23:26:44.093044826 +0800 @@ -1 +1 @@ -From 22aa9a9c7099e1f4b297899c33b4fea1131d3ac7 Mon Sep 17 00:00:00 2001 +From 37f8c86e53d081589faa324c6d6b034e1752014e Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 22aa9a9c7099e1f4b297899c33b4fea1131d3ac7 ] @@ -11 +13,0 @@ -Cc: stable@dpdk.org @@ -20 +22 @@ -index 298a5dae74..d764d4bc6a 100644 +index 6d53ff932d..5ec89719c6 100644 @@ -23 +25 @@ -@@ -2538,7 +2538,7 @@ virtio_dev_rx_async_submit(struct virtio_net *dev, struct vhost_virtqueue *vq, +@@ -2546,7 +2546,7 @@ virtio_dev_rx_async_submit(struct virtio_net *dev, struct vhost_virtqueue *vq,