[PATCH v1] common/cnxk: fix initialization of MCAM ID

Ankur Dwivedi adwivedi at marvell.com
Thu Sep 21 09:46:37 CEST 2023


The start and end mcam id is initialized when aged_flows_cnt is 0. The
boolean variable aging_enabled is not needed.

Fixes: d110c44d29e7 ("common/cnxk: support flow aging")

Signed-off-by: Ankur Dwivedi <adwivedi at marvell.com>
---
 drivers/common/cnxk/roc_npc_aging.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/common/cnxk/roc_npc_aging.c b/drivers/common/cnxk/roc_npc_aging.c
index 874a7cd4ff..4b845954b4 100644
--- a/drivers/common/cnxk/roc_npc_aging.c
+++ b/drivers/common/cnxk/roc_npc_aging.c
@@ -56,7 +56,6 @@ check_timeout_cycles(struct roc_npc *roc_npc, uint32_t mcam_id)
 	struct npc_age_flow_list_head *list;
 	struct npc_age_flow_entry *fl_iter;
 	struct roc_npc_flow_age *flow_age;
-	bool aging_enabled = false;
 
 	flow_age = &roc_npc->flow_age;
 	list = &npc->age_flow_list;
@@ -65,10 +64,9 @@ check_timeout_cycles(struct roc_npc *roc_npc, uint32_t mcam_id)
 		    fl_iter->flow->timeout_cycles < plt_tsc_cycles()) {
 			/* update bitmap */
 			plt_bitmap_set(flow_age->aged_flows, mcam_id);
-			if (!aging_enabled) {
+			if (flow_age->aged_flows_cnt == 0) {
 				flow_age->start_id = mcam_id;
 				flow_age->end_id = mcam_id;
-				aging_enabled = true;
 			}
 			if (flow_age->start_id > mcam_id)
 				flow_age->start_id = mcam_id;
-- 
2.25.1



More information about the dev mailing list