DPDK patches and discussions
 help / color / mirror / Atom feed
From: <psatheesh@marvell.com>
To: Nithin Dabilpuram <ndabilpuram@marvell.com>,
	Kiran Kumar K <kirankumark@marvell.com>,
	Sunil Kumar Kori <skori@marvell.com>,
	Satha Rao <skoteshwar@marvell.com>
Cc: <dev@dpdk.org>, Satheesh Paul <psatheesh@marvell.com>,
	Jerin Jacob <jerinj@marvell.com>
Subject: [dpdk-dev] [PATCH ] common/cnxk: fix ROC naming convention
Date: Fri, 18 Aug 2023 09:31:39 +0530	[thread overview]
Message-ID: <20230818040139.626967-1-psatheesh@marvell.com> (raw)

From: Satheesh Paul <psatheesh@marvell.com>

Fix ROC code naming convention.

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

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
---
 drivers/common/cnxk/roc_npc.h       |  2 +-
 drivers/common/cnxk/roc_npc_aging.c | 14 +++++++++-----
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/common/cnxk/roc_npc.h b/drivers/common/cnxk/roc_npc.h
index 2fb0aa7a4e..84c92f4c28 100644
--- a/drivers/common/cnxk/roc_npc.h
+++ b/drivers/common/cnxk/roc_npc.h
@@ -224,7 +224,7 @@ struct roc_npc_action_port_id {
 struct roc_npc_action_age {
 	uint32_t timeout : 24; /**< Time in seconds. */
 	uint32_t reserved : 8; /**< Reserved, must be zero. */
-	/** The user flow context, NULL means the rte_flow pointer. */
+	/** The user flow context, NULL means the flow pointer. */
 	void *context;
 };
 
diff --git a/drivers/common/cnxk/roc_npc_aging.c b/drivers/common/cnxk/roc_npc_aging.c
index 94126fe9fd..874a7cd4ff 100644
--- a/drivers/common/cnxk/roc_npc_aging.c
+++ b/drivers/common/cnxk/roc_npc_aging.c
@@ -62,7 +62,7 @@ check_timeout_cycles(struct roc_npc *roc_npc, uint32_t mcam_id)
 	list = &npc->age_flow_list;
 	TAILQ_FOREACH(fl_iter, list, next) {
 		if (fl_iter->flow->mcam_id == mcam_id &&
-		    fl_iter->flow->timeout_cycles < rte_get_timer_cycles()) {
+		    fl_iter->flow->timeout_cycles < plt_tsc_cycles()) {
 			/* update bitmap */
 			plt_bitmap_set(flow_age->aged_flows, mcam_id);
 			if (!aging_enabled) {
@@ -90,8 +90,8 @@ update_timeout_cycles(struct roc_npc *roc_npc, uint32_t mcam_id)
 	list = &npc->age_flow_list;
 	TAILQ_FOREACH(fl_iter, list, next) {
 		if (fl_iter->flow->mcam_id == mcam_id) {
-			fl_iter->flow->timeout_cycles = rte_get_timer_cycles() +
-				fl_iter->flow->timeout * rte_get_timer_hz();
+			fl_iter->flow->timeout_cycles = plt_tsc_cycles() +
+				fl_iter->flow->timeout * plt_tsc_hz();
 			break;
 		}
 	}
@@ -214,6 +214,11 @@ npc_age_flow_list_entry_add(struct roc_npc *roc_npc, struct roc_npc_flow *flow)
 	struct npc_age_flow_entry *new_entry;
 
 	new_entry = plt_zmalloc(sizeof(*new_entry), 0);
+	if (new_entry == NULL) {
+		plt_err("flow entry alloc failed");
+		return;
+	}
+
 	new_entry->flow = flow;
 	roc_npc->flow_age.age_flow_refcnt++;
 	/* List in ascending order of mcam entries */
@@ -269,8 +274,7 @@ npc_aging_ctrl_thread_create(struct roc_npc *roc_npc,
 
 	flow->age_context = age->context == NULL ? flow : age->context;
 	flow->timeout = age->timeout;
-	flow->timeout_cycles = rte_get_timer_cycles() + age->timeout *
-			       rte_get_timer_hz();
+	flow->timeout_cycles = plt_tsc_cycles() + age->timeout * plt_tsc_hz();
 
 	if (flow_age->age_flow_refcnt == 0) {
 		flow_age->aged_flows_get_thread_exit = false;
-- 
2.39.2


             reply	other threads:[~2023-08-18  4:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-18  4:01 psatheesh [this message]
2023-08-21 15:29 ` 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=20230818040139.626967-1-psatheesh@marvell.com \
    --to=psatheesh@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).