patch 'net/ice: fix memory leaks' has been queued to stable release 23.11.1
Xueming Li
xuemingl at nvidia.com
Tue Mar 5 10:45:57 CET 2024
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 <xuemingl at nvidia.com>
---
>From 943de5c27e81245ded7d392cea48dd3ee65898e5 Mon Sep 17 00:00:00 2001
From: Qi Zhang <qi.z.zhang at intel.com>
Date: Sun, 7 Jan 2024 06:50:53 -0500
Subject: [PATCH] net/ice: fix memory leaks
Cc: Xueming Li <xuemingl at nvidia.com>
[ 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 <qi.z.zhang at intel.com>
Acked-by: Wenjun Wu <wenjun1.wu at intel.com>
---
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 <xuemingl at nvidia.com>
+
+[ upstream commit 546ee62dd441730daae181e336f30b315c5fb16f ]
@@ -10 +12,0 @@
-Cc: stable at 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,
More information about the stable
mailing list