DPDK patches and discussions
 help / color / mirror / Atom feed
From: Rakesh Kudurumalla <rkudurumalla@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>, <jerinj@marvell.com>,
	Rakesh Kudurumalla <rkudurumalla@marvell.com>
Subject: [PATCH 1/3] common/cnxk: optimize ethdev teardown time
Date: Tue, 5 Dec 2023 15:30:46 +0530	[thread overview]
Message-ID: <20231205100048.1387058-1-rkudurumalla@marvell.com> (raw)

API mbox_alloc_msg_npa_aq_enq() mbox is called if SQ needs
to be updated from mbox response else mbox call to kernel
is bypassed reducing the time taken to complete
roc_nix_tm_sq_aura_fc() function.This reduces ethdev
teardown time by 20%.

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
---
 drivers/common/cnxk/roc_nix_tm_ops.c | 29 ++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/drivers/common/cnxk/roc_nix_tm_ops.c b/drivers/common/cnxk/roc_nix_tm_ops.c
index e1cef7a670..2c53472047 100644
--- a/drivers/common/cnxk/roc_nix_tm_ops.c
+++ b/drivers/common/cnxk/roc_nix_tm_ops.c
@@ -51,25 +51,26 @@ roc_nix_tm_sq_aura_fc(struct roc_nix_sq *sq, bool enable)
 		goto exit;
 
 	/* Read back npa aura ctx */
-	req = mbox_alloc_msg_npa_aq_enq(mbox);
-	if (req == NULL) {
-		rc = -ENOSPC;
-		goto exit;
-	}
+	if (enable) {
+		req = mbox_alloc_msg_npa_aq_enq(mbox);
+		if (req == NULL) {
+			rc = -ENOSPC;
+			goto exit;
+		}
 
-	req->aura_id = roc_npa_aura_handle_to_aura(aura_handle);
-	req->ctype = NPA_AQ_CTYPE_AURA;
-	req->op = NPA_AQ_INSTOP_READ;
+		req->aura_id = roc_npa_aura_handle_to_aura(aura_handle);
+		req->ctype = NPA_AQ_CTYPE_AURA;
+		req->op = NPA_AQ_INSTOP_READ;
 
-	rc = mbox_process_msg(mbox, (void *)&rsp);
-	if (rc)
-		goto exit;
+		rc = mbox_process_msg(mbox, (void *)&rsp);
+		if (rc)
+			goto exit;
 
-	/* Init when enabled as there might be no triggers */
-	if (enable)
+		/* Init when enabled as there might be no triggers */
 		*(volatile uint64_t *)sq->fc = rsp->aura.count;
-	else
+	} else {
 		*(volatile uint64_t *)sq->fc = sq->aura_sqb_bufs;
+	}
 	/* Sync write barrier */
 	plt_wmb();
 	rc = 0;
-- 
2.25.1


             reply	other threads:[~2023-12-05 10:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-05 10:00 Rakesh Kudurumalla [this message]
2023-12-05 10:00 ` [PATCH 2/3] common/cnxk: added new API to enable disable SQ Rakesh Kudurumalla
2023-12-05 10:00 ` [PATCH 3/3] net/cnxk: reduce Tx queue release time Rakesh Kudurumalla
2023-12-07  6:15   ` 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=20231205100048.1387058-1-rkudurumalla@marvell.com \
    --to=rkudurumalla@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).