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 73A6843B86 for ; Tue, 5 Mar 2024 10:49:54 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6E03D40A87; Tue, 5 Mar 2024 10:49:54 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2065.outbound.protection.outlook.com [40.107.243.65]) by mails.dpdk.org (Postfix) with ESMTP id 6C6594014F for ; Tue, 5 Mar 2024 10:49:52 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I52kRK5XzyO5t9804bK1T8TsHjr/JBXgY9n66GKH0ueK5VdA+Gw0+3xv4pkr5JQGh85QfyWbVSUdu9SZ1IEB4cdUDKh7/iVC5RswUD8je88oIX0PD6QFOesgGCTU/eIhv5vsSAY1/zadQPyO0n1YWG2vfPDqsZn2lZNGqQc+fDhJLJBzTYU/bd1dpN8NnomVze6DsZsbiu8LwAGcyNfv7K4hfc9Y8xyYbTKRs7fqqg9afmpqa/CTaTnOhxQHY7waJRkwZVEDO5RC7tYGwiM5qR6RwlE1CQQ6cicZLFbKdhV/GjDLZxdpyxl+vOJRMeshOpndn5lrn5iNTLtdYI4YJg== 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=AhIOEx3jnFaH3KecAK7xiDhkvxusTnLIBO12qBAMz/U=; b=f2yB5bWVkxW8J+9i+V9bkws7eFpNeBCtzWG0I8jQmieKRFLcdw8Aq9skOHNfRmfsgf2NMEHbm6I3joZd1Fksfp3Wm3M6E9KMAtLbpRSVCQCY3QbL8I5Dwp/IxwN4oQnjo3UuYAUN52xlTKPpOBsfvYXUgN+ygwnbsbWvHZZBtVMo1aSvOLzZ5goNF3zGoCV4U9yU8sMdnLASqcCJu0U5Kpqv27sZqmWn+TSB5uK4Ahx7bO0V6ZkJoUQ8yWQk6JiAp4TPRG+FOJnv72nNRA1DdF9dJ6IUfaQLl+BJRGxnQicXG0FDxn1ncTWmwGr2Z+sDg9kUhywUTW1q4SswhcC9Gg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=intel.com 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=AhIOEx3jnFaH3KecAK7xiDhkvxusTnLIBO12qBAMz/U=; b=sf0nZnGptqTRZY8JebiJHTv2OTyCGK4FrYMGIGnn+iwT2ZpZlsAyM5UIvJ5ivnexMsNqMwHbV6PVmZ2v0kq4LOpP3pwvSqU75H/Agcd/PvOIN7ADBE6MpiphqoIWgfgTFYoyRnRmdGyXXgIYBT8RGrrKF8eceyGwk7Nf1xiG3nSleKzAANPNNbOdzpxA2QRsOuMLAcCjlf60HUm1x46JxoS+06AD8ET0NPSTmYKSmZnVPpcwCEUvpOma7yBTQGGs4XnSy99ADnkz7c7UYyDpX5q0FphUbXYDThK/KcM9lSpsLOk7BpmTabPpCz3Ub83YT/JEmi677n/Hv2miVAPU3A== Received: from CY5PR03CA0002.namprd03.prod.outlook.com (2603:10b6:930:8::23) by SJ2PR12MB9005.namprd12.prod.outlook.com (2603:10b6:a03:53d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.40; Tue, 5 Mar 2024 09:49:50 +0000 Received: from CY4PEPF0000FCC2.namprd03.prod.outlook.com (2603:10b6:930:8:cafe::f7) by CY5PR03CA0002.outlook.office365.com (2603:10b6:930:8::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.39 via Frontend Transport; Tue, 5 Mar 2024 09:49:50 +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 CY4PEPF0000FCC2.mail.protection.outlook.com (10.167.242.104) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.11 via Frontend Transport; Tue, 5 Mar 2024 09:49:49 +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.986.41; Tue, 5 Mar 2024 01:49:37 -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.1258.12; Tue, 5 Mar 2024 01:49:36 -0800 From: Xueming Li To: Qi Zhang CC: Wenjun Wu , dpdk stable Subject: patch 'net/ice: fix memory leaks' has been queued to stable release 23.11.1 Date: Tue, 5 Mar 2024 17:45:57 +0800 Message-ID: <20240305094757.439387-17-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240305094757.439387-1-xuemingl@nvidia.com> References: <20240305094757.439387-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: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000FCC2:EE_|SJ2PR12MB9005:EE_ X-MS-Office365-Filtering-Correlation-Id: 7024e3d4-4d54-47e3-ad7a-08dc3cf99985 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qu3cB2wwVzyd0Um2ATjj/Mc92FEqgzqIFbidPqjcTzmCSdCcy53IrT7YxvlbRY754/f+3QEXYuHhFb0nO/OC4Nl6V4YKdLWb3A1kraYyeHsGhibqvF0BUkrCMed0qVoTLZsdLOrdXG9w9ordyI6/y+uDa1yI84J0d4CzlFl28MYSuIX4MggFHeHaXKenlRElA66Bk3t5JlsTXrOmwElK6etjguqz8IthNK4FgFS+W51sseWBfzn5oyseIdIB1ezlhd/8MjWFnLuLrM3+8HMqnNbFHQ4IvVG5nXG0unOL/CEyNf92zby1C16rE2QINV0tlfJbZeT8C54F1bdxeMuT4i8uJdUCoXWBP4bUy8MAG+GcD00mOAk2y9OhAtlzlhMd1zmIZ7DJBM+3GOiXXJuPnoYnJI5KFqyBGF2PAjpXcMavYKaR7GhpRu/xbWyHf5BhxyHFxrMPyoUZ3WtaHqcbyCgEZVMjOMuxBcmuomcfGBJ7r8nIAlO9aK22Ewxg0PmxcMGy4x0COK7l4AoYSXJr64NMeAqLwoVYZ/qpUo1oXU41GT8ttg/tZUWMWb4Onl9SUDhK4guG9iJZ5ru7floJgm1SBXhqK6yccec3W9vVpb51o56ud20WoiKWZTlxDYRGKnhbowdFKTwdHisYnVj+y4I2bfXlFjnUf+JXXsMV4e7Oy3otyc5D5o/OwJpwrgNwK0wFP/fF1el3m36IbSTrAieMCUtUF3yjiHwjZpzNPeqvg8gfiGfGOXJ8G+u/5hOQ 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:(13230031)(82310400014)(36860700004)(376005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Mar 2024 09:49:49.8559 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7024e3d4-4d54-47e3-ad7a-08dc3cf99985 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: CY4PEPF0000FCC2.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB9005 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.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/31/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=943de5c27e81245ded7d392cea48dd3ee65898e5 Thanks. Xueming Li --- >From 943de5c27e81245ded7d392cea48dd3ee65898e5 Mon Sep 17 00:00:00 2001 From: Qi Zhang Date: Sun, 7 Jan 2024 06:50:53 -0500 Subject: [PATCH] net/ice: fix memory leaks Cc: Xueming Li [ upstream commit 546ee62dd441730daae181e336f30b315c5fb16f ] Free memory for AQ buffer at icd_move_recfg_lan_txq Free memory for profile list at ice_tm_conf_uninit Fixes: 8c481c3bb65b ("net/ice: support queue and queue group bandwidth limit") Signed-off-by: Qi Zhang Acked-by: Wenjun Wu --- drivers/net/ice/ice_tm.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/ice/ice_tm.c b/drivers/net/ice/ice_tm.c index f5ea47ae83..65b9fdf320 100644 --- a/drivers/net/ice/ice_tm.c +++ b/drivers/net/ice/ice_tm.c @@ -58,8 +58,15 @@ void ice_tm_conf_uninit(struct rte_eth_dev *dev) { struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private); + struct ice_tm_shaper_profile *shaper_profile; struct ice_tm_node *tm_node; + /* clear profile */ + while ((shaper_profile = TAILQ_FIRST(&pf->tm_conf.shaper_profile_list))) { + TAILQ_REMOVE(&pf->tm_conf.shaper_profile_list, shaper_profile, node); + rte_free(shaper_profile); + } + /* clear node configuration */ while ((tm_node = TAILQ_FIRST(&pf->tm_conf.queue_list))) { TAILQ_REMOVE(&pf->tm_conf.queue_list, tm_node, node); @@ -648,6 +655,8 @@ static int ice_move_recfg_lan_txq(struct rte_eth_dev *dev, uint16_t buf_size = ice_struct_size(buf, txqs, 1); buf = (struct ice_aqc_move_txqs_data *)ice_malloc(hw, sizeof(*buf)); + if (buf == NULL) + return -ENOMEM; queue_parent_node = queue_sched_node->parent; buf->src_teid = queue_parent_node->info.node_teid; @@ -659,6 +668,7 @@ static int ice_move_recfg_lan_txq(struct rte_eth_dev *dev, NULL, buf, buf_size, &txqs_moved, NULL); if (ret || txqs_moved == 0) { PMD_DRV_LOG(ERR, "move lan queue %u failed", queue_id); + rte_free(buf); return ICE_ERR_PARAM; } @@ -668,12 +678,14 @@ static int ice_move_recfg_lan_txq(struct rte_eth_dev *dev, } else { PMD_DRV_LOG(ERR, "invalid children number %d for queue %u", queue_parent_node->num_children, queue_id); + rte_free(buf); return ICE_ERR_PARAM; } dst_node->children[dst_node->num_children++] = queue_sched_node; queue_sched_node->parent = dst_node; ice_sched_query_elem(hw, queue_sched_node->info.node_teid, &queue_sched_node->info); + rte_free(buf); return ret; } -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-03-05 17:39:31.595962520 +0800 +++ 0016-net-ice-fix-memory-leaks.patch 2024-03-05 17:39:30.683566490 +0800 @@ -1 +1 @@ -From 546ee62dd441730daae181e336f30b315c5fb16f Mon Sep 17 00:00:00 2001 +From 943de5c27e81245ded7d392cea48dd3ee65898e5 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 546ee62dd441730daae181e336f30b315c5fb16f ] @@ -10 +12,0 @@ -Cc: stable@dpdk.org @@ -19 +21 @@ -index b570798f07..c00ecb6a97 100644 +index f5ea47ae83..65b9fdf320 100644 @@ -22 +24 @@ -@@ -59,8 +59,15 @@ void +@@ -58,8 +58,15 @@ void @@ -38 +40 @@ -@@ -636,6 +643,8 @@ static int ice_move_recfg_lan_txq(struct rte_eth_dev *dev, +@@ -648,6 +655,8 @@ static int ice_move_recfg_lan_txq(struct rte_eth_dev *dev, @@ -47 +49 @@ -@@ -647,6 +656,7 @@ static int ice_move_recfg_lan_txq(struct rte_eth_dev *dev, +@@ -659,6 +668,7 @@ static int ice_move_recfg_lan_txq(struct rte_eth_dev *dev, @@ -55 +57 @@ -@@ -656,12 +666,14 @@ static int ice_move_recfg_lan_txq(struct rte_eth_dev *dev, +@@ -668,12 +678,14 @@ static int ice_move_recfg_lan_txq(struct rte_eth_dev *dev,