DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ankur Dwivedi <adwivedi@marvell.com>
To: <dev@dpdk.org>
Cc: <jerinj@marvell.com>, <ndabilpuram@marvell.com>,
	<kirankumark@marvell.com>, <skori@marvell.com>,
	<skoteshwar@marvell.com>, Ankur Dwivedi <adwivedi@marvell.com>
Subject: [PATCH v1] common/cnxk: fix initialization of MCAM ID
Date: Thu, 21 Sep 2023 13:16:37 +0530	[thread overview]
Message-ID: <20230921074637.4043468-1-adwivedi@marvell.com> (raw)

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


             reply	other threads:[~2023-09-21  7:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-21  7:46 Ankur Dwivedi [this message]
2023-09-27 15:44 ` Jerin Jacob

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230921074637.4043468-1-adwivedi@marvell.com \
    --to=adwivedi@marvell.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=kirankumark@marvell.com \
    --cc=ndabilpuram@marvell.com \
    --cc=skori@marvell.com \
    --cc=skoteshwar@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).