patch 'net/nfp: fix representor port queue release' has been queued to stable release 23.11.2
Xueming Li
xuemingl at nvidia.com
Fri Jul 12 12:43:54 CEST 2024
Hi,
FYI, your patch has been queued to stable release 23.11.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/14/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=884c6d943aaea21cda14fe9a37d7d4c61f7976c8
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From 884c6d943aaea21cda14fe9a37d7d4c61f7976c8 Mon Sep 17 00:00:00 2001
From: Long Wu <long.wu at corigine.com>
Date: Tue, 19 Mar 2024 15:07:54 +0800
Subject: [PATCH] net/nfp: fix representor port queue release
Cc: Xueming Li <xuemingl at nvidia.com>
[ upstream commit 57f62be098be4c95964691183504c77e31797a42 ]
The PF representor port's queue is different from the VF/physical
representor port. So the release process in close port should
be different too.
Fixes: a256a1227dbe ("net/nfp: fix resource leak for exit of 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>
---
.../net/nfp/flower/nfp_flower_representor.c | 69 ++++++++++++++-----
1 file changed, 50 insertions(+), 19 deletions(-)
diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c
index 4937c0780a..dba9ceee95 100644
--- a/drivers/net/nfp/flower/nfp_flower_representor.c
+++ b/drivers/net/nfp/flower/nfp_flower_representor.c
@@ -291,6 +291,54 @@ nfp_flower_repr_tx_burst(void *tx_queue,
return sent;
}
+static void
+nfp_flower_repr_free_queue(struct nfp_flower_representor *repr)
+{
+ uint16_t i;
+ struct rte_eth_dev *eth_dev = repr->eth_dev;
+
+ for (i = 0; i < eth_dev->data->nb_tx_queues; i++)
+ rte_free(eth_dev->data->tx_queues[i]);
+
+ for (i = 0; i < eth_dev->data->nb_rx_queues; i++)
+ rte_free(eth_dev->data->rx_queues[i]);
+}
+
+static void
+nfp_flower_pf_repr_close_queue(struct nfp_flower_representor *repr)
+{
+ struct rte_eth_dev *eth_dev = repr->eth_dev;
+
+ /*
+ * We assume that the DPDK application is stopping all the
+ * threads/queues before calling the device close function.
+ */
+ nfp_net_disable_queues(eth_dev);
+
+ /* Clear queues */
+ nfp_net_close_tx_queue(eth_dev);
+ nfp_net_close_rx_queue(eth_dev);
+}
+
+static void
+nfp_flower_repr_close_queue(struct nfp_flower_representor *repr)
+{
+ switch (repr->repr_type) {
+ case NFP_REPR_TYPE_PHYS_PORT:
+ nfp_flower_repr_free_queue(repr);
+ break;
+ case NFP_REPR_TYPE_PF:
+ nfp_flower_pf_repr_close_queue(repr);
+ break;
+ case NFP_REPR_TYPE_VF:
+ nfp_flower_repr_free_queue(repr);
+ break;
+ default:
+ PMD_DRV_LOG(ERR, "Unsupported repr port type.");
+ break;
+ }
+}
+
static int
nfp_flower_repr_uninit(struct rte_eth_dev *eth_dev)
{
@@ -348,8 +396,6 @@ nfp_flower_repr_dev_close(struct rte_eth_dev *dev)
uint16_t i;
struct nfp_net_hw *hw;
struct nfp_pf_dev *pf_dev;
- struct nfp_net_txq *this_tx_q;
- struct nfp_net_rxq *this_rx_q;
struct nfp_flower_representor *repr;
struct nfp_app_fw_flower *app_fw_flower;
@@ -361,26 +407,11 @@ nfp_flower_repr_dev_close(struct rte_eth_dev *dev)
hw = app_fw_flower->pf_hw;
pf_dev = hw->pf_dev;
- /*
- * We assume that the DPDK application is stopping all the
- * threads/queues before calling the device close function.
- */
- nfp_net_disable_queues(dev);
-
- /* Clear queues */
- for (i = 0; i < dev->data->nb_tx_queues; i++) {
- this_tx_q = dev->data->tx_queues[i];
- nfp_net_reset_tx_queue(this_tx_q);
- }
-
- for (i = 0; i < dev->data->nb_rx_queues; i++) {
- this_rx_q = dev->data->rx_queues[i];
- nfp_net_reset_rx_queue(this_rx_q);
- }
-
if (pf_dev->app_fw_id != NFP_APP_FW_FLOWER_NIC)
return -EINVAL;
+ nfp_flower_repr_close_queue(repr);
+
nfp_flower_repr_free(repr, repr->repr_type);
for (i = 0; i < MAX_FLOWER_VFS; i++) {
--
2.34.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2024-07-12 18:40:14.719638353 +0800
+++ 0008-net-nfp-fix-representor-port-queue-release.patch 2024-07-12 18:40:13.906594251 +0800
@@ -1 +1 @@
-From 57f62be098be4c95964691183504c77e31797a42 Mon Sep 17 00:00:00 2001
+From 884c6d943aaea21cda14fe9a37d7d4c61f7976c8 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 57f62be098be4c95964691183504c77e31797a42 ]
@@ -11 +13,0 @@
-Cc: stable at dpdk.org
@@ -21 +23 @@
-index b2c55879ca..d4c3c30682 100644
+index 4937c0780a..dba9ceee95 100644
@@ -24 +26 @@
-@@ -305,6 +305,54 @@ nfp_flower_repr_tx_burst(void *tx_queue,
+@@ -291,6 +291,54 @@ nfp_flower_repr_tx_burst(void *tx_queue,
@@ -79 +81 @@
-@@ -362,8 +410,6 @@ nfp_flower_repr_dev_close(struct rte_eth_dev *dev)
+@@ -348,8 +396,6 @@ nfp_flower_repr_dev_close(struct rte_eth_dev *dev)
@@ -88 +90 @@
-@@ -375,26 +421,11 @@ nfp_flower_repr_dev_close(struct rte_eth_dev *dev)
+@@ -361,26 +407,11 @@ nfp_flower_repr_dev_close(struct rte_eth_dev *dev)
More information about the stable
mailing list