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 E2EA4A034F for ; Wed, 10 Nov 2021 07:40:48 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D960640142; Wed, 10 Nov 2021 07:40:48 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2050.outbound.protection.outlook.com [40.107.244.50]) by mails.dpdk.org (Postfix) with ESMTP id DE41A40142 for ; Wed, 10 Nov 2021 07:40:46 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E6LGWa4hw+B7rz/uKYn48QiT57X9ggg3VtaaA8b21HudvjIJ2XrsYGqM5LgL9+FlKqbITu+MR1OtCSOf0rGY1Q5ghy6GUCracI7zTtDS39QiT+mtDzVYhMe+NZ7fkZIkdYudN/P8YAJqMto6QAA+PwoWHNBUYVercAH5QE+phLqYNnJhkjDYpLiIr1Zhm3Kcz1N2sE7dmzen0aMXpO0N153xBTuodHRkeBX1bBn+o7fRn5mt9yxFgmtnAecSZk7qkyZOQJH+nfJnRULuIp461JqIb3GEBSkgyAwvb0E3SmclZxx8c2BAJ5cclxNmLiFmEHsQZcOPinPoeWOpjn6YIQ== 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=3BsuTxg7gow4WglLtRq0Gt9Y24e8eHrW0eAqYAXL+To=; b=mjSvooVoc3/DsJ2jgySaU+S+R30l1ZPkVJkyRYRdqMYUOwpplEeK42OqXctPrLxookjac3o7c2kpyUXAtsm7V+1OFQacRd66liQYVv0CebDoMulKrVVAhf8MEQR1JfLHhH3x4TmC4nE+ufZb49kp/JzZ5oJGqfB5COhH4VWGcECh1rsjsNF2w/AGoRQ5FGw7rRhY+FIFRyOTkh+UjMKbJK0xeVaQeo2ICtG5fcdEMJ5kH3GnOkUJGH2NLMEWdaXZz/fG0GUDLKAx0b7fmZj1AMtCrK+b2Un5vgkj5BFt/O8SqGBLDvT7v0rJePO4uvODlwEN/Th6sfzNswlZ3EUsaQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine 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=3BsuTxg7gow4WglLtRq0Gt9Y24e8eHrW0eAqYAXL+To=; b=PSQ+KuJM15s9mrsVQRuwGxSq1YPemBVjz/kHID2/7fb67MpFe8pBo+IsfCnCnhTAXpu/CJGki3X+O5XdnizhJKEqZ/L273ZiDNh15V+y1wp0uMyto368Z7+GR4jhq7eup6Q7pMneuOP8o1PJcIrzrSR88Qw4lHKGfvNbuSYqYwn8C1WKXULY/Z0vaG1yfzC1KczIhG3BwmWGqx674FAsjPyA1LTDzK18gNfZ+KrBkKSfP5XlxuzHFNpd/epNK8k4vCCww5ypt5GjUDK/qxFLh7dek4aAtXoxYYeudE0hgykEN19poSeawSee3/77b/k/KNNHDB3eSa0MvQGZEoQzcQ== Received: from DS7PR03CA0245.namprd03.prod.outlook.com (2603:10b6:5:3b3::10) by MWHPR12MB1502.namprd12.prod.outlook.com (2603:10b6:301:10::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.10; Wed, 10 Nov 2021 06:40:45 +0000 Received: from DM6NAM11FT012.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b3:cafe::20) by DS7PR03CA0245.outlook.office365.com (2603:10b6:5:3b3::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 06:40:44 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by DM6NAM11FT012.mail.protection.outlook.com (10.13.173.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 06:40:44 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 10 Nov 2021 06:40:42 +0000 From: Xueming Li To: Michael Baum CC: Luca Boccassi , Matan Azrad , "dpdk stable" Date: Wed, 10 Nov 2021 14:29:19 +0800 Message-ID: <20211110063216.2744012-76-xuemingl@nvidia.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211110063216.2744012-1-xuemingl@nvidia.com> References: <20211110063216.2744012-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 20f139ce-0a56-493d-7126-08d9a41505a3 X-MS-TrafficTypeDiagnostic: MWHPR12MB1502: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: f0Y2FJdiQhz42kc+0d06FGnxORlMPa2/BeQz8pVPlmayeqhLzc1IczYRSrdJKKAsXYmG5EX2GkUWNeO8nczxJIaLWiDylscRweBCfJbXnlGOyP/7Agqihr85dK7AeHcBaYf21B0xAwJ6IDS5jBPAzi54cxN1i5CtUF707mENotUNM11urbTtH4TNkOMAsXvH8FP7+l2wtHuaMihl/UAhxqyu9DCMeB+mFV8148JYnmUOYp0mVj7x7ea2WRlr9OnVO+L599u0oPhKmjpWeei8SoAxLAeVv6hWskJ2sheAa63oAEG92GbC2fxzA/IY/Oq27uutg2k9HH5z4nc8a9FPjVUFA065Gu/43tdEBiIOWHEf5zyzGIzt8oIbCLr6kTsWyRHBh7DbKFuMXGG7G/RhKuL+VdM5/VVFQYdfQnE7q8dINXhjsOxQifC8aAg2x9k1ezyQt/6wDO+abUs33/5u77YHoZHefFWf0pfZHJ2K1M9BWfL+P8yk8J85e03VBn7xvkhVvKemR+lt3lOU+9wzX6UcNxOSanv5+W5dYlM7q+cXE4p2b3oSfnrSbuPXQh7dHtlCzPYj9sCHbAEK3i1U7+nDW6ie4v8Ozq5P8s4p98XpjzZXwx80iuGFhxn4vY/snUzG1ghgfSgQLSUZhIdZy2UxpqtT+Nta/bFkqi3u9RWx1LPpxi8Whh5WK4L5xZXIQgp1i+NdBv4D14D4WQVd59GV5eTfi6f3nz3xCHcwAIhCOKzP49BPuExS54YKSVgIjglTawkHgcmFTwUBnDxtg8+fZ0L9fZVBhc8N5STGkQn8ChG50CsKHdiK+wMP8FtNKQ6yUspDcZZZwZFa/60YKg== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(7696005)(356005)(86362001)(7636003)(36860700001)(53546011)(4001150100001)(36756003)(37006003)(54906003)(508600001)(8676002)(70586007)(6636002)(70206006)(5660300002)(2616005)(26005)(16526019)(36906005)(966005)(47076005)(82310400003)(4326008)(426003)(55016002)(8936002)(83380400001)(336012)(1076003)(6286002)(316002)(6666004)(6862004)(186003)(2906002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 06:40:44.4462 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 20f139ce-0a56-493d-7126-08d9a41505a3 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT012.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1502 Subject: [dpdk-stable] patch 'net/mlx5: fix memory leak on context allocation failure' has been queued to stable release 20.11.4 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/12/21. 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/5d3374aff1b527d7421339ec1c1017e82ee63400 Thanks. Xueming Li --- >From 5d3374aff1b527d7421339ec1c1017e82ee63400 Mon Sep 17 00:00:00 2001 From: Michael Baum Date: Sun, 12 Sep 2021 13:36:23 +0300 Subject: [PATCH] net/mlx5: fix memory leak on context allocation failure Cc: Xueming Li [ upstream commit c76db6a4964e91a79d877a009d15d5c62507136a ] In shared device context creation, there is a missing validation when one of the btree memory allocation fails that will cause a memory leak. This adds a proper check to clean resources in case of failure. Fixes: 632f0f19056f ("net/mlx5: manage shared counters in three-level table") Signed-off-by: Michael Baum Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index d6e780d50c..cb984debcc 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -1021,6 +1021,8 @@ error: MLX5_ASSERT(sh); if (sh->cnt_id_tbl) mlx5_l3t_destroy(sh->cnt_id_tbl); + if (sh->share_cache.cache.table) + mlx5_mr_btree_free(&sh->share_cache.cache); if (sh->tis) claim_zero(mlx5_devx_cmd_destroy(sh->tis)); if (sh->td) -- 2.33.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-10 14:17:05.406904962 +0800 +++ 0075-net-mlx5-fix-memory-leak-on-context-allocation-failu.patch 2021-11-10 14:17:01.837413030 +0800 @@ -1 +1 @@ -From c76db6a4964e91a79d877a009d15d5c62507136a Mon Sep 17 00:00:00 2001 +From 5d3374aff1b527d7421339ec1c1017e82ee63400 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit c76db6a4964e91a79d877a009d15d5c62507136a ] @@ -12 +14,0 @@ -Cc: stable@dpdk.org @@ -21 +23 @@ -index f84e061fe7..f0ec2d1279 100644 +index d6e780d50c..cb984debcc 100644 @@ -24 +26 @@ -@@ -1254,6 +1254,8 @@ error: +@@ -1021,6 +1021,8 @@ error: