Skip to contentSkip to conversation

common/cnxk: fix initialization of MCAM ID

PATCH In review Ankur Dwivedi 2 participants 2 messages Sep 21, 2023 – Sep 27, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 common/cnxk: fix initialization of MCAM ID

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")
---
 drivers/common/cnxk/roc_npc_aging.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/common/cnxk/roc_npc_aging.c +1 -3
index 874a7cd4ff..4b845954b4 100644
@@ -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;
Signature · 1 line
2.25.1
#1 lore raw
Quoted 7 lines · Ankur Dwivedi

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")

Updated the git commit as follows and applied to
dpdk-next-net-mrvl/for-next-net. Thanks

common/cnxk: fix aging initialization

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")
Quoted 31 lines
---
 drivers/common/cnxk/roc_npc_aging.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/common/cnxk/roc_npc_aging.c +1 -4
index 874a7cd4ff..4b845954b4 100644
@@ -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