patch 'net/nfp: fix device resource freeing' has been queued to stable release 23.11.1

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

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From a581442d9ba98f8a21bf4e1d71e0cfa85d1e1eb1 Mon Sep 17 00:00:00 2001
From: Long Wu <long.wu at corigine.com>
Date: Thu, 14 Dec 2023 18:24:30 +0800
Subject: [PATCH] net/nfp: fix device resource freeing
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 09309f87358b3a538af47e31340898a15bb34d85 ]

Set the representor array to NULL to avoid that close interface
does not free some resource.

Representor array points to dev_private which is already freed by
'rte_eth_dev_release_port()', and 'nfp_flower_repr_dev_close()' requires
pointers to be NULL to proceed freeing other resources.

Fixes: 7c596721ae5f ("net/nfp: fix resource leak for flower firmware")

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

diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c
index a18b3951da..4937c0780a 100644
--- a/drivers/net/nfp/flower/nfp_flower_representor.c
+++ b/drivers/net/nfp/flower/nfp_flower_representor.c
@@ -294,17 +294,30 @@ nfp_flower_repr_tx_burst(void *tx_queue,
 static int
 nfp_flower_repr_uninit(struct rte_eth_dev *eth_dev)
 {
+	uint16_t index;
 	struct nfp_flower_representor *repr;

 	repr = eth_dev->data->dev_private;
 	rte_ring_free(repr->ring);

+	if (repr->repr_type == NFP_REPR_TYPE_PHYS_PORT) {
+		index = NFP_FLOWER_CMSG_PORT_PHYS_PORT_NUM(repr->port_id);
+		repr->app_fw_flower->phy_reprs[index] = NULL;
+	} else {
+		index = repr->vf_id;
+		repr->app_fw_flower->vf_reprs[index] = NULL;
+	}
+
 	return 0;
 }

 static int
-nfp_flower_pf_repr_uninit(__rte_unused struct rte_eth_dev *eth_dev)
+nfp_flower_pf_repr_uninit(struct rte_eth_dev *eth_dev)
 {
+	struct nfp_flower_representor *repr = eth_dev->data->dev_private;
+
+	repr->app_fw_flower->pf_repr = NULL;
+
 	return 0;
 }

--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:33.892517897 +0800
+++ 0096-net-nfp-fix-device-resource-freeing.patch	2024-03-05 17:39:30.863566496 +0800
@@ -1 +1 @@
-From 09309f87358b3a538af47e31340898a15bb34d85 Mon Sep 17 00:00:00 2001
+From a581442d9ba98f8a21bf4e1d71e0cfa85d1e1eb1 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 09309f87358b3a538af47e31340898a15bb34d85 ]
@@ -14 +16,0 @@
-Cc: stable at dpdk.org
@@ -24 +26 @@
-index 27ea3891bd..5f7c1fa737 100644
+index a18b3951da..4937c0780a 100644


More information about the stable mailing list