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

Xueming Li xuemingl at nvidia.com
Tue Mar 5 10:47:00 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=c2a5c0d0855ae555373d84f9a350844c1eae8845

Thanks.

Xueming Li <xuemingl at nvidia.com>

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

[ upstream commit a7904d1c6b4fef73d9a8b32b6f6293ba697d10c2 ]

Fix the resource leak problem in the logic of VF.

Fixes: f26e82397f6d ("net/nfp: implement xstats")

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_vf.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/net/nfp/nfp_ethdev_vf.c b/drivers/net/nfp/nfp_ethdev_vf.c
index 7927f53403..88da593190 100644
--- a/drivers/net/nfp/nfp_ethdev_vf.c
+++ b/drivers/net/nfp/nfp_ethdev_vf.c
@@ -160,13 +160,17 @@ nfp_netvf_set_link_down(struct rte_eth_dev *dev __rte_unused)
 static int
 nfp_netvf_close(struct rte_eth_dev *dev)
 {
+	struct nfp_net_hw *net_hw;
 	struct rte_pci_device *pci_dev;

 	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
 		return 0;

+	net_hw = dev->data->dev_private;
 	pci_dev = RTE_ETH_DEV_TO_PCI(dev);

+	rte_free(net_hw->eth_xstats_base);
+
 	/*
 	 * We assume that the DPDK application is stopping all the
 	 * threads/queues before calling the device close function.
@@ -323,7 +327,7 @@ nfp_netvf_init(struct rte_eth_dev *eth_dev)
 	if (eth_dev->data->mac_addrs == NULL) {
 		PMD_INIT_LOG(ERR, "Failed to space for MAC address");
 		err = -ENOMEM;
-		goto dev_err_ctrl_map;
+		goto free_xstats;
 	}

 	nfp_read_mac(hw);
@@ -360,8 +364,8 @@ nfp_netvf_init(struct rte_eth_dev *eth_dev)

 	return 0;

-dev_err_ctrl_map:
-		nfp_cpp_area_free(net_hw->ctrl_area);
+free_xstats:
+	rte_free(net_hw->eth_xstats_base);

 	return err;
 }
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:33.390713080 +0800
+++ 0079-net-nfp-fix-resource-leak-for-VF.patch	2024-03-05 17:39:30.823566495 +0800
@@ -1 +1 @@
-From a7904d1c6b4fef73d9a8b32b6f6293ba697d10c2 Mon Sep 17 00:00:00 2001
+From c2a5c0d0855ae555373d84f9a350844c1eae8845 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit a7904d1c6b4fef73d9a8b32b6f6293ba697d10c2 ]
@@ -9 +11,0 @@
-Cc: stable at dpdk.org


More information about the stable mailing list