patch 'common/cnxk: fix flow aging cleanup' has been queued to stable release 23.11.2

Xueming Li xuemingl at nvidia.com
Fri Jul 12 12:44:56 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=2428f9f2e30e1c69ea3ab0d7cd31b3e27d24986b

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 2428f9f2e30e1c69ea3ab0d7cd31b3e27d24986b Mon Sep 17 00:00:00 2001
From: Satheesh Paul <psatheesh at marvell.com>
Date: Wed, 8 May 2024 16:27:13 +0530
Subject: [PATCH] common/cnxk: fix flow aging cleanup
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 85e9542d47009eeea2d4c4eaa703715c1c3bf4f7 ]

The aged flows poll thread is not stopped before NPC cleanup
resulting in a segmentation fault. Fixing this by stopping
aged flows poll thread before proceeding with NPC cleanup.

Fixes: 357f5ebc8a24 ("common/cnxk: support flow aging")

Signed-off-by: Satheesh Paul <psatheesh at marvell.com>
Reviewed-by: Kiran Kumar K <kirankumark at marvell.com>
---
 drivers/common/cnxk/roc_npc.c       | 5 +++--
 drivers/common/cnxk/roc_npc_aging.c | 8 +++++---
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/common/cnxk/roc_npc.c b/drivers/common/cnxk/roc_npc.c
index a0d88c0743..fcede1d0b7 100644
--- a/drivers/common/cnxk/roc_npc.c
+++ b/drivers/common/cnxk/roc_npc.c
@@ -351,6 +351,8 @@ roc_npc_fini(struct roc_npc *roc_npc)
 	struct npc *npc = roc_npc_to_npc_priv(roc_npc);
 	int rc;
 
+	npc_aging_ctrl_thread_destroy(roc_npc);
+
 	rc = npc_flow_free_all_resources(npc);
 	if (rc) {
 		plt_err("Error when deleting NPC MCAM entries, counters");
@@ -1626,8 +1628,7 @@ roc_npc_flow_destroy(struct roc_npc *roc_npc, struct roc_npc_flow *flow)
 	if (flow->has_age_action)
 		npc_age_flow_list_entry_delete(roc_npc, flow);
 
-	if (roc_npc->flow_age.age_flow_refcnt == 0 &&
-		plt_thread_is_valid(roc_npc->flow_age.aged_flows_poll_thread))
+	if (roc_npc->flow_age.age_flow_refcnt == 0)
 		npc_aging_ctrl_thread_destroy(roc_npc);
 
 done:
diff --git a/drivers/common/cnxk/roc_npc_aging.c b/drivers/common/cnxk/roc_npc_aging.c
index e0f2dc2291..15f6e61d76 100644
--- a/drivers/common/cnxk/roc_npc_aging.c
+++ b/drivers/common/cnxk/roc_npc_aging.c
@@ -303,9 +303,11 @@ npc_aging_ctrl_thread_destroy(struct roc_npc *roc_npc)
 	struct roc_npc_flow_age *flow_age;
 
 	flow_age = &roc_npc->flow_age;
-	flow_age->aged_flows_get_thread_exit = true;
-	plt_thread_join(flow_age->aged_flows_poll_thread, NULL);
-	npc_aged_flows_bitmap_free(roc_npc);
+	if (plt_thread_is_valid(flow_age->aged_flows_poll_thread)) {
+		flow_age->aged_flows_get_thread_exit = true;
+		plt_thread_join(flow_age->aged_flows_poll_thread, NULL);
+		npc_aged_flows_bitmap_free(roc_npc);
+	}
 }
 
 void *
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-12 18:40:17.311592342 +0800
+++ 0070-common-cnxk-fix-flow-aging-cleanup.patch	2024-07-12 18:40:14.176594219 +0800
@@ -1 +1 @@
-From 85e9542d47009eeea2d4c4eaa703715c1c3bf4f7 Mon Sep 17 00:00:00 2001
+From 2428f9f2e30e1c69ea3ab0d7cd31b3e27d24986b Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 85e9542d47009eeea2d4c4eaa703715c1c3bf4f7 ]
@@ -11 +13,0 @@
-Cc: stable at dpdk.org
@@ -21 +23 @@
-index d6ad3756bb..37e1a6a7ef 100644
+index a0d88c0743..fcede1d0b7 100644
@@ -24 +26 @@
-@@ -389,6 +389,8 @@ roc_npc_fini(struct roc_npc *roc_npc)
+@@ -351,6 +351,8 @@ roc_npc_fini(struct roc_npc *roc_npc)
@@ -33 +35 @@
-@@ -1810,8 +1812,7 @@ roc_npc_flow_destroy(struct roc_npc *roc_npc, struct roc_npc_flow *flow)
+@@ -1626,8 +1628,7 @@ roc_npc_flow_destroy(struct roc_npc *roc_npc, struct roc_npc_flow *flow)


More information about the stable mailing list