patch 'net/nfp: fix resource leak for CoreNIC firmware' has been queued to stable release 23.11.1

Xueming Li xuemingl at nvidia.com
Tue Mar 5 10:46:55 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=1d53d5495ba4c5f4a23bc2dbe9f26c33c15e74a3

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 1d53d5495ba4c5f4a23bc2dbe9f26c33c15e74a3 Mon Sep 17 00:00:00 2001
From: Chaoyong He <chaoyong.he at corigine.com>
Date: Mon, 4 Dec 2023 09:57:13 +0800
Subject: [PATCH] net/nfp: fix resource leak for CoreNIC firmware
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 8b8f116b199e31795ecd5cedb12302f10c0ae5a4 ]

Fix the resource leak problem in the logic of CoreNIC firmware
application.

Fixes: 646ea79ce481 ("net/nfp: move PF functions into its own file")

Signed-off-by: Chaoyong He <chaoyong.he at corigine.com>
Reviewed-by: Long Wu <long.wu at corigine.com>
Reviewed-by: Peng Zhang <peng.zhang at corigine.com>
---
 drivers/net/nfp/nfp_ethdev.c | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index 25feb8e394..38ee1c399a 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -310,6 +310,18 @@ nfp_net_keepalive_stop(struct nfp_multi_pf *multi_pf)
 	rte_eal_alarm_cancel(nfp_net_beat_timer, (void *)multi_pf);
 }

+static void
+nfp_net_uninit(struct rte_eth_dev *eth_dev)
+{
+	struct nfp_net_hw *net_hw;
+
+	net_hw = eth_dev->data->dev_private;
+	rte_free(net_hw->eth_xstats_base);
+	nfp_ipsec_uninit(eth_dev);
+	if (net_hw->mac_stats_area != NULL)
+		nfp_cpp_area_release_free(net_hw->mac_stats_area);
+}
+
 /* Reset and stop device. The device can not be restarted. */
 static int
 nfp_net_close(struct rte_eth_dev *dev)
@@ -1130,12 +1142,11 @@ port_cleanup:
 				app_fw_nic->ports[id]->eth_dev != NULL) {
 			struct rte_eth_dev *tmp_dev;
 			tmp_dev = app_fw_nic->ports[id]->eth_dev;
-			nfp_ipsec_uninit(tmp_dev);
+			nfp_net_uninit(tmp_dev);
 			rte_eth_dev_release_port(tmp_dev);
-			app_fw_nic->ports[id] = NULL;
 		}
 	}
-	nfp_cpp_area_free(pf_dev->ctrl_area);
+	nfp_cpp_area_release_free(pf_dev->ctrl_area);
 app_cleanup:
 	rte_free(app_fw_nic);

--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:33.240549175 +0800
+++ 0074-net-nfp-fix-resource-leak-for-CoreNIC-firmware.patch	2024-03-05 17:39:30.803566494 +0800
@@ -1 +1 @@
-From 8b8f116b199e31795ecd5cedb12302f10c0ae5a4 Mon Sep 17 00:00:00 2001
+From 1d53d5495ba4c5f4a23bc2dbe9f26c33c15e74a3 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 8b8f116b199e31795ecd5cedb12302f10c0ae5a4 ]
@@ -10 +12,0 @@
-Cc: stable at dpdk.org
@@ -20 +22 @@
-index 2a80a592f2..c132e97d1a 100644
+index 25feb8e394..38ee1c399a 100644
@@ -23 +25 @@
-@@ -317,6 +317,18 @@ nfp_net_keepalive_stop(struct nfp_multi_pf *multi_pf)
+@@ -310,6 +310,18 @@ nfp_net_keepalive_stop(struct nfp_multi_pf *multi_pf)
@@ -42 +44 @@
-@@ -1137,12 +1149,11 @@ port_cleanup:
+@@ -1130,12 +1142,11 @@ port_cleanup:


More information about the stable mailing list