* [PATCH v1] common/cnxk: fix initialization of MCAM ID
@ 2023-09-21 7:46 Ankur Dwivedi
2023-09-27 15:44 ` Jerin Jacob
0 siblings, 1 reply; 2+ messages in thread
From: Ankur Dwivedi @ 2023-09-21 7:46 UTC (permalink / raw)
To: dev; +Cc: jerinj, ndabilpuram, kirankumark, skori, skoteshwar, 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")
Signed-off-by: Ankur Dwivedi <adwivedi@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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v1] common/cnxk: fix initialization of MCAM ID
2023-09-21 7:46 [PATCH v1] common/cnxk: fix initialization of MCAM ID Ankur Dwivedi
@ 2023-09-27 15:44 ` Jerin Jacob
0 siblings, 0 replies; 2+ messages in thread
From: Jerin Jacob @ 2023-09-27 15:44 UTC (permalink / raw)
To: Ankur Dwivedi; +Cc: dev, jerinj, ndabilpuram, kirankumark, skori, skoteshwar
On Thu, Sep 21, 2023 at 1:16 PM Ankur Dwivedi <adwivedi@marvell.com> wrote:
>
> 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@marvell.com>
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")
Cc: stable@dpdk.org
Signed-off-by: Ankur Dwivedi <adwivedi@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
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-09-27 15:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-21 7:46 [PATCH v1] common/cnxk: fix initialization of MCAM ID Ankur Dwivedi
2023-09-27 15:44 ` Jerin Jacob
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).