DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 1/3] common/cnxk: optimize ethdev teardown time
@ 2023-12-05 10:00 Rakesh Kudurumalla
  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
  0 siblings, 2 replies; 4+ messages in thread
From: Rakesh Kudurumalla @ 2023-12-05 10:00 UTC (permalink / raw)
  To: Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao
  Cc: dev, jerinj, Rakesh Kudurumalla

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/3] common/cnxk: added new API to enable disable SQ
  2023-12-05 10:00 [PATCH 1/3] common/cnxk: optimize ethdev teardown time Rakesh Kudurumalla
@ 2023-12-05 10:00 ` Rakesh Kudurumalla
  2023-12-05 10:00 ` [PATCH 3/3] net/cnxk: reduce Tx queue release time Rakesh Kudurumalla
  1 sibling, 0 replies; 4+ messages in thread
From: Rakesh Kudurumalla @ 2023-12-05 10:00 UTC (permalink / raw)
  To: Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao
  Cc: dev, jerinj, Rakesh Kudurumalla

Added a new roc API to disable SQB aura FC
and update SQ state to disabled state in TX queue
stop.The same SQ status is verified during sq flush
to enable or disable SQB aura FC during ethdev
teardown.This fix reduces teardown time by 90%.

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
---
 drivers/common/cnxk/roc_nix.h       |  2 ++
 drivers/common/cnxk/roc_nix_queue.c | 15 +++++++++++++++
 drivers/common/cnxk/roc_nix_tm.c    | 20 ++++++++++++--------
 drivers/common/cnxk/version.map     |  1 +
 4 files changed, 30 insertions(+), 8 deletions(-)

diff --git a/drivers/common/cnxk/roc_nix.h b/drivers/common/cnxk/roc_nix.h
index a96cf73757..82997c38ce 100644
--- a/drivers/common/cnxk/roc_nix.h
+++ b/drivers/common/cnxk/roc_nix.h
@@ -401,6 +401,7 @@ struct roc_nix_sq {
 	void *sqe_mem;
 	void *fc;
 	uint8_t tc;
+	bool enable;
 };
 
 struct roc_nix_link_info {
@@ -952,6 +953,7 @@ void __roc_api roc_nix_cq_head_tail_get(struct roc_nix *roc_nix, uint16_t qid,
 					uint32_t *head, uint32_t *tail);
 int __roc_api roc_nix_sq_init(struct roc_nix *roc_nix, struct roc_nix_sq *sq);
 int __roc_api roc_nix_sq_fini(struct roc_nix_sq *sq);
+int __roc_api roc_nix_sq_ena_dis(struct roc_nix_sq *sq, bool enable);
 void __roc_api roc_nix_sq_head_tail_get(struct roc_nix *roc_nix, uint16_t qid,
 					uint32_t *head, uint32_t *tail);
 
diff --git a/drivers/common/cnxk/roc_nix_queue.c b/drivers/common/cnxk/roc_nix_queue.c
index f96d5c3a96..ae4e0ea40c 100644
--- a/drivers/common/cnxk/roc_nix_queue.c
+++ b/drivers/common/cnxk/roc_nix_queue.c
@@ -92,6 +92,20 @@ nix_rq_ena_dis(struct dev *dev, struct roc_nix_rq *rq, bool enable)
 	return rc;
 }
 
+int
+roc_nix_sq_ena_dis(struct roc_nix_sq *sq, bool enable)
+{
+	int rc = 0;
+
+	rc = roc_nix_tm_sq_aura_fc(sq, enable);
+	if (rc)
+		goto done;
+
+	sq->enable = enable;
+done:
+	return rc;
+}
+
 int
 roc_nix_rq_ena_dis(struct roc_nix_rq *rq, bool enable)
 {
@@ -1409,6 +1423,7 @@ roc_nix_sq_init(struct roc_nix *roc_nix, struct roc_nix_sq *sq)
 	}
 	mbox_put(mbox);
 
+	sq->enable = true;
 	nix->sqs[qid] = sq;
 	sq->io_addr = nix->base + NIX_LF_OP_SENDX(0);
 	/* Evenly distribute LMT slot for each sq */
diff --git a/drivers/common/cnxk/roc_nix_tm.c b/drivers/common/cnxk/roc_nix_tm.c
index ece88b5e99..6a61e448a1 100644
--- a/drivers/common/cnxk/roc_nix_tm.c
+++ b/drivers/common/cnxk/roc_nix_tm.c
@@ -887,10 +887,12 @@ nix_tm_sq_flush_pre(struct roc_nix_sq *sq)
 		if (!sq)
 			continue;
 
-		rc = roc_nix_tm_sq_aura_fc(sq, false);
-		if (rc) {
-			plt_err("Failed to disable sqb aura fc, rc=%d", rc);
-			goto cleanup;
+		if (sq->enable) {
+			rc = roc_nix_tm_sq_aura_fc(sq, false);
+			if (rc) {
+				plt_err("Failed to disable sqb aura fc, rc=%d", rc);
+				goto cleanup;
+			}
 		}
 
 		/* Wait for sq entries to be flushed */
@@ -997,10 +999,12 @@ nix_tm_sq_flush_post(struct roc_nix_sq *sq)
 			once = true;
 		}
 
-		rc = roc_nix_tm_sq_aura_fc(s_sq, true);
-		if (rc) {
-			plt_err("Failed to enable sqb aura fc, rc=%d", rc);
-			return rc;
+		if (s_sq->enable) {
+			rc = roc_nix_tm_sq_aura_fc(s_sq, true);
+			if (rc) {
+				plt_err("Failed to enable sqb aura fc, rc=%d", rc);
+				return rc;
+			}
 		}
 	}
 
diff --git a/drivers/common/cnxk/version.map b/drivers/common/cnxk/version.map
index aa884a8fe2..4907b62013 100644
--- a/drivers/common/cnxk/version.map
+++ b/drivers/common/cnxk/version.map
@@ -339,6 +339,7 @@ INTERNAL {
 	roc_nix_rx_queue_intr_disable;
 	roc_nix_rx_queue_intr_enable;
 	roc_nix_sq_dump;
+	roc_nix_sq_ena_dis;
 	roc_nix_sq_fini;
 	roc_nix_sq_head_tail_get;
 	roc_nix_sq_init;
-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 3/3] net/cnxk: reduce Tx queue release time
  2023-12-05 10:00 [PATCH 1/3] common/cnxk: optimize ethdev teardown time Rakesh Kudurumalla
  2023-12-05 10:00 ` [PATCH 2/3] common/cnxk: added new API to enable disable SQ Rakesh Kudurumalla
@ 2023-12-05 10:00 ` Rakesh Kudurumalla
  2023-12-07  6:15   ` Jerin Jacob
  1 sibling, 1 reply; 4+ messages in thread
From: Rakesh Kudurumalla @ 2023-12-05 10:00 UTC (permalink / raw)
  To: Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao
  Cc: dev, jerinj, Rakesh Kudurumalla

Invoked newly added roc API to disable
SQB aura FC during TX queue start and TX queue
stop. This fix reduces ethdev teardown time

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
---
 drivers/net/cnxk/cnxk_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/cnxk/cnxk_ethdev.c b/drivers/net/cnxk/cnxk_ethdev.c
index 5e11bbb017..2372a4e793 100644
--- a/drivers/net/cnxk/cnxk_ethdev.c
+++ b/drivers/net/cnxk/cnxk_ethdev.c
@@ -1521,7 +1521,7 @@ cnxk_nix_tx_queue_start(struct rte_eth_dev *eth_dev, uint16_t qid)
 	if (data->tx_queue_state[qid] == RTE_ETH_QUEUE_STATE_STARTED)
 		return 0;
 
-	rc = roc_nix_tm_sq_aura_fc(sq, true);
+	rc = roc_nix_sq_ena_dis(sq, true);
 	if (rc) {
 		plt_err("Failed to enable sq aura fc, txq=%u, rc=%d", qid, rc);
 		goto done;
@@ -1543,7 +1543,7 @@ cnxk_nix_tx_queue_stop(struct rte_eth_dev *eth_dev, uint16_t qid)
 	if (data->tx_queue_state[qid] == RTE_ETH_QUEUE_STATE_STOPPED)
 		return 0;
 
-	rc = roc_nix_tm_sq_aura_fc(sq, false);
+	rc = roc_nix_sq_ena_dis(sq, false);
 	if (rc) {
 		plt_err("Failed to disable sqb aura fc, txq=%u, rc=%d", qid,
 			rc);
-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 3/3] net/cnxk: reduce Tx queue release time
  2023-12-05 10:00 ` [PATCH 3/3] net/cnxk: reduce Tx queue release time Rakesh Kudurumalla
@ 2023-12-07  6:15   ` Jerin Jacob
  0 siblings, 0 replies; 4+ messages in thread
From: Jerin Jacob @ 2023-12-07  6:15 UTC (permalink / raw)
  To: Rakesh Kudurumalla
  Cc: Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao,
	dev, jerinj

On Tue, Dec 5, 2023 at 3:39 PM Rakesh Kudurumalla
<rkudurumalla@marvell.com> wrote:
>
> Invoked newly added roc API to disable
> SQB aura FC during TX queue start and TX queue
> stop. This fix reduces ethdev teardown time
>
> Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> ---



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


commit 48e0c652ed7116df61db6a0d1cf3f0b450faec79 (HEAD -> for-main)
Author: Rakesh Kudurumalla <rkudurumalla@marvell.com>
Date:   Tue Dec 5 15:30:48 2023 +0530

    net/cnxk: reduce Tx queue release time

    Invoked newly added roc API to disable SQB aura FC
    during TX queue start and TX queue stop.

    This fix reduces ethdev teardown time

    Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>

commit 3f2604b698e530c8296030de3be60d242d7fc761
Author: Rakesh Kudurumalla <rkudurumalla@marvell.com>
Date:   Tue Dec 5 15:30:47 2023 +0530

    common/cnxk: support to enable disable SQ

    Added a new ROC API to disable SQB aura FC and update SQ state
    to disabled state in TX queue stop.

    The same SQ status is verified during sq flush to enable or
    disable SQB aura FC during ethdev teardown.

    This fix reduces teardown time by 90%.

    Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>

commit 6ed4c08ec7023a119e181b8e29442c3cc95c48ce
Author: Rakesh Kudurumalla <rkudurumalla@marvell.com>
Date:   Tue Dec 5 15:30:46 2023 +0530

    common/cnxk: optimize ethdev teardown time

    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>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-12-07  6:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-05 10:00 [PATCH 1/3] common/cnxk: optimize ethdev teardown time Rakesh Kudurumalla
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

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