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 8C5BF470E5 for ; Thu, 25 Dec 2025 10:26:13 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 83DCF402C5; Thu, 25 Dec 2025 10:26:13 +0100 (CET) Received: from BN1PR04CU002.outbound.protection.outlook.com (mail-eastus2azon11010004.outbound.protection.outlook.com [52.101.56.4]) by mails.dpdk.org (Postfix) with ESMTP id 0E9A640262 for ; Thu, 25 Dec 2025 10:26:12 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KMnDmTqhJ3NqjCZSG+T63MSmyhOS1l5xRObjnx4BSg7dsWOyolS/S+Wv9BmuMMFZhJQ9yfLMRmAes6ZfIdBoptJyV9H8yqDBbOznYwVwXDuX9wJL4IMNujC2SGyTeHu0+slV1WR2vQGIsu0WF9tduxAYU/1AF2lcKPNhMVmK4YNz2h/9gTHs3tGC/DpYvSw9grftQ8zU38kRfshAs9wHSKmj/iqIyNRKD0mkXbbvDo6vG2jsKLx4c71/fhDWNrbQLJrQbl2aNosTdZV/r84cFatke+m3/dGtEDgf/Z8ixRPsuOH/Lzz2HsVT7FSyFelofCZhId9G1+eXUHaIzNbudw== 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=03pd+WcgQ3l6fGGK8Zld32hTQ8YZ6CnauKjIvJ4z//w=; b=xNFFm4a1kG/ZXH88bhme5F//yahskXbsWC4MtMBE5wXw7JjJJhOK2yXZysVYbBfW3s1a/y+TZKI7CWeKKLOPUb/icwMt9GNFfobduyZqVjUE3jVKUOx4IwKm4cTxBBUvm860ItIT58DZM8psMtLyi4ZRW3pQ5Kiq+l4wfiyEvwIPETyirpufx7GxYjaCI/dFEsg3dcgK72Kr/MhVzCQiOR4nzaUZzrl6ZEj/kzZn4ql+AJaOmIdFX/ln/jhgDuAjOgK7t5/yDF71XfRCNtCj8brQWdL7illx2M6xBN13JqPyN2BD0jRRvzXGnMfavNIwBPlz9SZ+YPzPjUPnGSuQiA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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 (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=03pd+WcgQ3l6fGGK8Zld32hTQ8YZ6CnauKjIvJ4z//w=; b=bhKzkj6jXQ7VPMXdAyMKFo3xbrpBX1034WVXGKaGlMPjaHt5gt68LdR+xbGbLQ9MSpxwO4/8Y5poGpujoP8PZLDtgnY0TH7FKLB9H5UQUmEvOEX41gedv/BJ1N7lrF6OJUgmhfTaACsDzrIPJ3QTDxznfsb3ZqBXopZ2VbxJfUlPtS+3lVMelKnJ56dB2zruE3IJ+M9UiWXf74NXeP913qoIFrcQi6nhub+H/VJjT4uszl5T2JdxjlYW6GrxXz4tF3/zpe46G0gNtYeXzuijyZzhLStx+ULWaVpVRJc6gOoKGhDBPra8nWLVmbIXAML79GNtxrDu0915U4ZHoeIfCA== Received: from DM6PR10CA0008.namprd10.prod.outlook.com (2603:10b6:5:60::21) by SJ0PR12MB8167.namprd12.prod.outlook.com (2603:10b6:a03:4e6::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9434.11; Thu, 25 Dec 2025 09:26:08 +0000 Received: from CY4PEPF0000FCC3.namprd03.prod.outlook.com (2603:10b6:5:60:cafe::48) by DM6PR10CA0008.outlook.office365.com (2603:10b6:5:60::21) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9456.11 via Frontend Transport; Thu, 25 Dec 2025 09:26:06 +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 CY4PEPF0000FCC3.mail.protection.outlook.com (10.167.242.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9456.9 via Frontend Transport; Thu, 25 Dec 2025 09:26:07 +0000 Received: from rnnvmail202.nvidia.com (10.129.68.7) 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.2562.20; Thu, 25 Dec 2025 01:25:59 -0800 Received: from rnnvmail202.nvidia.com (10.129.68.7) by rnnvmail202.nvidia.com (10.129.68.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Thu, 25 Dec 2025 01:25:59 -0800 Received: from nvidia.com (10.127.8.12) by mail.nvidia.com (10.129.68.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20 via Frontend Transport; Thu, 25 Dec 2025 01:25:58 -0800 From: Shani Peretz To: Nupur Uttarwar CC: Dariusz Sosnowski , dpdk stable Subject: patch 'net/mlx5/hws: fix buddy memory allocation' has been queued to stable release 23.11.6 Date: Thu, 25 Dec 2025 11:18:52 +0200 Message-ID: <20251225091938.345892-91-shperetz@nvidia.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251225091938.345892-1-shperetz@nvidia.com> References: <20251221145746.763179-93-shperetz@nvidia.com> <20251225091938.345892-1-shperetz@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000FCC3:EE_|SJ0PR12MB8167:EE_ X-MS-Office365-Filtering-Correlation-Id: a965919a-1c6e-40a8-cf74-08de4397a268 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|36860700013|376014|82310400026|13003099007; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?Cza6+VgVp4NU9UZHokk4yL6SSDly8PtiPOSMYcgOIO+HtMYq1tInGO23mG9h?= =?us-ascii?Q?02PjAD9eFP8qTnzuJwHGhW8b+K5ItFQ+ly5/qIgoedTKa56r+t3f6BWIXuDZ?= =?us-ascii?Q?Zw/JopYSkD5J0e29mJBCxL+prGH4Uc6x/EdolGvL2jWbR8TzHzZvf86Hu5ne?= =?us-ascii?Q?OkpWnRJliHZ//9o8wFhQdKhA64xvS7DhBxS+II6NQvR/tCpStJIhgEUyLvgy?= =?us-ascii?Q?mkhVYTFXqM/oK+2Ah1GglZtJoUVjHBwUQv47QFVOJInNXG+PaoRSiVFx8idF?= =?us-ascii?Q?Ra7qZuilsZTGV1/C+TPv77dM3T4Z8WM6GGy+90WB8GBKlj5emuMfPMPw2kv1?= =?us-ascii?Q?K0DanbilwveXjgwtoxb4Y4zI//pFnk3icGBT++wr7mt/pmfoDD/bJXBUzGeB?= =?us-ascii?Q?9l6VT6pvVn1ObIdcGmUvag2CxMYH/zS0VQH8e8WWkjNesaiBwuyIfixz3uzc?= =?us-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FYQ0bttRVaJYV3D0hfedst0UGWwgC3?= =?us-ascii?Q?oz+IHOepva1FIXSQEPKTRpW78kUVRqmHm7I16+MC8YPubaLbXfvocGUPR6CC?= =?us-ascii?Q?syWnOJ8X3VFH1swjObXADpBEAumDJj3Mn8IZw8U4k6dahFjgdwoUo/Pf7KTf?= =?us-ascii?Q?mtOY3KLO70GAV49prGubsvBHilPQZ9btJsXPsm4UIp+/eKDoY/8E7Ctf3OsU?= =?us-ascii?Q?JXlGRlR7BO/Q4xWPPWVHsU48ZG9NAWijfmWueNt7?= 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)(13003099007); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Dec 2025 09:26:07.6041 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a965919a-1c6e-40a8-cf74-08de4397a268 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: CY4PEPF0000FCC3.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB8167 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.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 12/30/25. 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/shanipr/dpdk-stable This queued commit can be viewed at: https://github.com/shanipr/dpdk-stable/commit/0811aec6ad49ac3a5f3296af8ee97bb6b6ee709e Thanks. Shani --- >From 0811aec6ad49ac3a5f3296af8ee97bb6b6ee709e Mon Sep 17 00:00:00 2001 From: Nupur Uttarwar Date: Wed, 12 Nov 2025 09:47:39 +0200 Subject: [PATCH] net/mlx5/hws: fix buddy memory allocation [ upstream commit 8d1fe10768d2749d00ceb7124866c61d31164380 ] `buddy` was erroroneously declared as static. When multiple threads call this routine, they set the same static variable corrupting pool data and can cause potential double free when releasing resources. Fixes: b4dd7bcb0dcb ("net/mlx5/hws: add pool and buddy") Signed-off-by: Nupur Uttarwar Acked-by: Dariusz Sosnowski --- .mailmap | 1 + drivers/net/mlx5/hws/mlx5dr_buddy.c | 1 + drivers/net/mlx5/hws/mlx5dr_pool.c | 3 +-- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.mailmap b/.mailmap index 1296224156..5298e5dd6a 100644 --- a/.mailmap +++ b/.mailmap @@ -1078,6 +1078,7 @@ Nizan Zorea Noa Ezra Nobuhiro Miki Norbert Ciosek +Nupur Uttarwar Odi Assli Ofer Dagan Ognjen Joldzic diff --git a/drivers/net/mlx5/hws/mlx5dr_buddy.c b/drivers/net/mlx5/hws/mlx5dr_buddy.c index 394ca71217..abfbdf1be5 100644 --- a/drivers/net/mlx5/hws/mlx5dr_buddy.c +++ b/drivers/net/mlx5/hws/mlx5dr_buddy.c @@ -147,6 +147,7 @@ void mlx5dr_buddy_cleanup(struct mlx5dr_buddy_mem *buddy) simple_free(buddy->num_free); simple_free(buddy->bits); + simple_free(buddy); } int mlx5dr_buddy_alloc_mem(struct mlx5dr_buddy_mem *buddy, int order) diff --git a/drivers/net/mlx5/hws/mlx5dr_pool.c b/drivers/net/mlx5/hws/mlx5dr_pool.c index b7b532c7cf..a99182e0ca 100644 --- a/drivers/net/mlx5/hws/mlx5dr_pool.c +++ b/drivers/net/mlx5/hws/mlx5dr_pool.c @@ -167,7 +167,7 @@ static struct mlx5dr_buddy_mem * mlx5dr_pool_buddy_get_next_buddy(struct mlx5dr_pool *pool, int idx, uint32_t order, bool *is_new_buddy) { - static struct mlx5dr_buddy_mem *buddy; + struct mlx5dr_buddy_mem *buddy; uint32_t new_buddy_size; buddy = pool->db.buddy_manager->buddies[idx]; @@ -271,7 +271,6 @@ static void mlx5dr_pool_buddy_db_uninit(struct mlx5dr_pool *pool) buddy = pool->db.buddy_manager->buddies[i]; if (buddy) { mlx5dr_buddy_cleanup(buddy); - simple_free(buddy); pool->db.buddy_manager->buddies[i] = NULL; } } -- 2.43.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-12-25 11:16:40.832800636 +0200 +++ 0091-net-mlx5-hws-fix-buddy-memory-allocation.patch 2025-12-25 11:16:36.253823000 +0200 @@ -1 +1 @@ -From 8d1fe10768d2749d00ceb7124866c61d31164380 Mon Sep 17 00:00:00 2001 +From 0811aec6ad49ac3a5f3296af8ee97bb6b6ee709e Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 8d1fe10768d2749d00ceb7124866c61d31164380 ] + @@ -22 +24 @@ -index f9c5622e5d..efc66fd48c 100644 +index 1296224156..5298e5dd6a 100644 @@ -25 +27,2 @@ -@@ -1180,6 +1180,7 @@ Noa Ezra +@@ -1078,6 +1078,7 @@ Nizan Zorea + Noa Ezra @@ -28 +30,0 @@ - Norbert Zulinski @@ -46 +48 @@ -index 8e3718ac42..e383027d3e 100644 +index b7b532c7cf..a99182e0ca 100644