DPDK patches and discussions
 help / color / mirror / Atom feed
From: Hemant Agrawal <hemant.agrawal@nxp.com>
To: dev@dpdk.org
Cc: ferruh.yigit@intel.com, Nipun Gupta <nipun.gupta@nxp.com>
Subject: [dpdk-dev] [PATCH 05/10] bus/dpaa: make vdqcr configurable
Date: Thu, 21 Jun 2018 15:13:59 +0530	[thread overview]
Message-ID: <1529574244-18997-5-git-send-email-hemant.agrawal@nxp.com> (raw)
In-Reply-To: <1529574244-18997-1-git-send-email-hemant.agrawal@nxp.com>

From: Nipun Gupta <nipun.gupta@nxp.com>

This patch add support for configurable vdqcr exact flag.
This boost the performance, however this can give
side effects for some extra packet fetch. Which has been
taken care in the patch as well.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
---
 drivers/bus/dpaa/base/qbman/qman.c  |  4 ++--
 drivers/bus/dpaa/include/fsl_qman.h |  3 ++-
 drivers/crypto/dpaa_sec/dpaa_sec.c  | 19 ++++++++++++++++---
 drivers/net/dpaa/dpaa_rxtx.c        | 18 +++++++++++++++---
 4 files changed, 35 insertions(+), 9 deletions(-)

diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c
index 13c4315..f5fe5ef 100644
--- a/drivers/bus/dpaa/base/qbman/qman.c
+++ b/drivers/bus/dpaa/base/qbman/qman.c
@@ -2002,13 +2002,13 @@ int qman_query_congestion(struct qm_mcr_querycongestion *congestion)
 	return 0;
 }
 
-int qman_set_vdq(struct qman_fq *fq, u16 num)
+int qman_set_vdq(struct qman_fq *fq, u16 num, uint32_t vdqcr_flags)
 {
 	struct qman_portal *p = get_affine_portal();
 	uint32_t vdqcr;
 	int ret = -EBUSY;
 
-	vdqcr = QM_VDQCR_EXACT;
+	vdqcr = vdqcr_flags;
 	vdqcr |= QM_VDQCR_NUMFRAMES_SET(num);
 
 	if ((fq->state != qman_fq_state_parked) &&
diff --git a/drivers/bus/dpaa/include/fsl_qman.h b/drivers/bus/dpaa/include/fsl_qman.h
index e4ad7ae..b18cf03 100644
--- a/drivers/bus/dpaa/include/fsl_qman.h
+++ b/drivers/bus/dpaa/include/fsl_qman.h
@@ -1332,10 +1332,11 @@ unsigned int qman_portal_poll_rx(unsigned int poll_limit,
  * qman_set_vdq - Issue a volatile dequeue command
  * @fq: Frame Queue on which the volatile dequeue command is issued
  * @num: Number of Frames requested for volatile dequeue
+ * @vdqcr_flags: QM_VDQCR_EXACT flag to for VDQCR command
  *
  * This function will issue a volatile dequeue command to the QMAN.
  */
-int qman_set_vdq(struct qman_fq *fq, u16 num);
+int qman_set_vdq(struct qman_fq *fq, u16 num, uint32_t vdqcr_flags);
 
 /**
  * qman_dequeue - Get the DQRR entry after volatile dequeue command
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
index 06f7e43..a07869f 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -526,12 +526,25 @@ dpaa_sec_deq(struct dpaa_sec_qp *qp, struct rte_crypto_op **ops, int nb_ops)
 {
 	struct qman_fq *fq;
 	unsigned int pkts = 0;
-	int ret;
+	int num_rx_bufs, ret;
 	struct qm_dqrr_entry *dq;
+	uint32_t vdqcr_flags = 0;
 
 	fq = &qp->outq;
-	ret = qman_set_vdq(fq, (nb_ops > DPAA_MAX_DEQUEUE_NUM_FRAMES) ?
-				DPAA_MAX_DEQUEUE_NUM_FRAMES : nb_ops);
+	/*
+	 * Until request for four buffers, we provide exact number of buffers.
+	 * Otherwise we do not set the QM_VDQCR_EXACT flag.
+	 * Not setting QM_VDQCR_EXACT flag can provide two more buffers than
+	 * requested, so we request two less in this case.
+	 */
+	if (nb_ops < 4) {
+		vdqcr_flags = QM_VDQCR_EXACT;
+		num_rx_bufs = nb_ops;
+	} else {
+		num_rx_bufs = nb_ops > DPAA_MAX_DEQUEUE_NUM_FRAMES ?
+			(DPAA_MAX_DEQUEUE_NUM_FRAMES - 2) : (nb_ops - 2);
+	}
+	ret = qman_set_vdq(fq, num_rx_bufs, vdqcr_flags);
 	if (ret)
 		return 0;
 
diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c
index 805bc30..168b77e 100644
--- a/drivers/net/dpaa/dpaa_rxtx.c
+++ b/drivers/net/dpaa/dpaa_rxtx.c
@@ -560,7 +560,8 @@ uint16_t dpaa_eth_queue_rx(void *q,
 	struct qman_fq *fq = q;
 	struct qm_dqrr_entry *dq;
 	uint32_t num_rx = 0, ifid = ((struct dpaa_if *)fq->dpaa_intf)->ifid;
-	int ret;
+	int num_rx_bufs, ret;
+	uint32_t vdqcr_flags = 0;
 
 	if (likely(fq->is_static))
 		return dpaa_eth_queue_portal_rx(fq, bufs, nb_bufs);
@@ -573,8 +574,19 @@ uint16_t dpaa_eth_queue_rx(void *q,
 		}
 	}
 
-	ret = qman_set_vdq(fq, (nb_bufs > DPAA_MAX_DEQUEUE_NUM_FRAMES) ?
-				DPAA_MAX_DEQUEUE_NUM_FRAMES : nb_bufs);
+	/* Until request for four buffers, we provide exact number of buffers.
+	 * Otherwise we do not set the QM_VDQCR_EXACT flag.
+	 * Not setting QM_VDQCR_EXACT flag can provide two more buffers than
+	 * requested, so we request two less in this case.
+	 */
+	if (nb_bufs < 4) {
+		vdqcr_flags = QM_VDQCR_EXACT;
+		num_rx_bufs = nb_bufs;
+	} else {
+		num_rx_bufs = nb_bufs > DPAA_MAX_DEQUEUE_NUM_FRAMES ?
+			(DPAA_MAX_DEQUEUE_NUM_FRAMES - 2) : (nb_bufs - 2);
+	}
+	ret = qman_set_vdq(fq, num_rx_bufs, vdqcr_flags);
 	if (ret)
 		return 0;
 
-- 
2.7.4

  parent reply	other threads:[~2018-06-21  9:45 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-21  9:43 [dpdk-dev] [PATCH 01/10] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal
2018-06-21  9:43 ` [dpdk-dev] [PATCH 02/10] bus/dpaa: fix svr id fetch location Hemant Agrawal
2018-06-21  9:43 ` [dpdk-dev] [PATCH 03/10] bus/dpaa: optimize the fq callback routine Hemant Agrawal
2018-06-21  9:43 ` [dpdk-dev] [PATCH 04/10] bus/dpaa: implement new of API to get MAC address Hemant Agrawal
2018-06-21  9:43 ` Hemant Agrawal [this message]
2018-06-21  9:44 ` [dpdk-dev] [PATCH 06/10] net/dpaa: support default queue mode Hemant Agrawal
2018-06-21  9:44 ` [dpdk-dev] [PATCH 07/10] net/dpaa: remove experimental tag from PMD APIs Hemant Agrawal
2018-06-21  9:44 ` [dpdk-dev] [PATCH 08/10] net/dpaa2: fix the prefetch Rx to honor nb pkts Hemant Agrawal
2018-06-21  9:44 ` [dpdk-dev] [PATCH 09/10] bus/dpaa: cleanup unnecessary global variables Hemant Agrawal
2018-06-21  9:44 ` [dpdk-dev] [PATCH 10/10] bus/fslmc: " Hemant Agrawal
2018-07-04  9:43 ` [dpdk-dev] [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal
2018-07-04  9:43   ` [dpdk-dev] [PATCH v2 02/16] bus/dpaa: fix svr id fetch location Hemant Agrawal
2018-07-06  4:44     ` Shreyansh Jain
2018-07-04  9:43   ` [dpdk-dev] [PATCH v2 03/16] bus/dpaa: fix the buffer offset setting in FMAN Hemant Agrawal
2018-07-04  9:43   ` [dpdk-dev] [PATCH v2 04/16] net/dpaa: fix the queue err handling and logs Hemant Agrawal
2018-07-06  4:56     ` Shreyansh Jain
2018-07-04  9:43   ` [dpdk-dev] [PATCH v2 05/16] net/dpaa2: fix the prefetch Rx to honor nb pkts Hemant Agrawal
2018-07-06  5:01     ` Shreyansh Jain
2018-07-06  8:13       ` Hemant Agrawal
2018-07-04  9:43   ` [dpdk-dev] [PATCH v2 06/16] bus/dpaa: optimize the fq callback routine Hemant Agrawal
2018-07-06  5:07     ` Shreyansh Jain
2018-07-04  9:43   ` [dpdk-dev] [PATCH v2 07/16] bus/dpaa: implement new of API to get MAC address Hemant Agrawal
2018-07-06  5:24     ` Shreyansh Jain
2018-07-04  9:43   ` [dpdk-dev] [PATCH v2 08/16] bus/dpaa: make vdqcr configurable Hemant Agrawal
2018-07-06  5:24     ` Shreyansh Jain
2018-07-04  9:43   ` [dpdk-dev] [PATCH v2 09/16] net/dpaa: support default queue mode Hemant Agrawal
2018-07-06  5:28     ` Shreyansh Jain
2018-07-06  8:13       ` Hemant Agrawal
2018-07-04  9:43   ` [dpdk-dev] [PATCH v2 10/16] net/dpaa: remove experimental tag from PMD APIs Hemant Agrawal
2018-07-06  5:29     ` Shreyansh Jain
2018-07-04  9:43   ` [dpdk-dev] [PATCH v2 11/16] bus/dpaa: cleanup unnecessary global variables Hemant Agrawal
2018-07-06  4:36     ` Shreyansh Jain
2018-07-04  9:43   ` [dpdk-dev] [PATCH v2 12/16] bus/fslmc: " Hemant Agrawal
2018-07-04  9:43   ` [dpdk-dev] [PATCH v2 13/16] drivers: support function name in logs trace Hemant Agrawal
2018-07-06  6:34     ` Shreyansh Jain
2018-07-04  9:43   ` [dpdk-dev] [PATCH v2 14/16] net/dpaa: move the push queue set to global init Hemant Agrawal
2018-07-06  6:35     ` Shreyansh Jain
2018-07-04  9:43   ` [dpdk-dev] [PATCH v2 15/16] bus/dpaa: add support for SG config Hemant Agrawal
2018-07-06  4:38     ` Shreyansh Jain
2018-07-04  9:43   ` [dpdk-dev] [PATCH v2 16/16] net/dpaa: implement scatter offload support Hemant Agrawal
2018-07-06  6:41     ` Shreyansh Jain
2018-07-04 10:59   ` [dpdk-dev] [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16 Shreyansh Jain
2018-07-06  8:09   ` [dpdk-dev] [PATCH v3 " Hemant Agrawal
2018-07-06  8:09     ` [dpdk-dev] [PATCH v3 02/16] bus/dpaa: fix svr id fetch location Hemant Agrawal
2018-07-06  8:10     ` [dpdk-dev] [PATCH v3 03/16] bus/dpaa: fix the buffer offset setting in FMAN Hemant Agrawal
2018-07-06 12:28       ` Shreyansh Jain
2018-07-06  8:10     ` [dpdk-dev] [PATCH v3 04/16] net/dpaa: fix the queue err handling and logs Hemant Agrawal
2018-07-06  8:10     ` [dpdk-dev] [PATCH v3 05/16] net/dpaa2: fix the prefetch Rx to honor nb pkts Hemant Agrawal
2018-07-06  8:10     ` [dpdk-dev] [PATCH v3 06/16] bus/dpaa: optimize the fq callback routine Hemant Agrawal
2018-07-06  8:10     ` [dpdk-dev] [PATCH v3 07/16] bus/dpaa: implement new of API to get MAC address Hemant Agrawal
2018-07-06  8:10     ` [dpdk-dev] [PATCH v3 08/16] bus/dpaa: make vdqcr configurable Hemant Agrawal
2018-07-06  8:10     ` [dpdk-dev] [PATCH v3 09/16] net/dpaa: support default queue mode Hemant Agrawal
2018-07-06  8:10     ` [dpdk-dev] [PATCH v3 10/16] net/dpaa: remove experimental tag from PMD APIs Hemant Agrawal
2018-07-06  8:10     ` [dpdk-dev] [PATCH v3 11/16] bus/dpaa: cleanup unnecessary global variables Hemant Agrawal
2018-07-06  8:10     ` [dpdk-dev] [PATCH v3 12/16] bus/fslmc: " Hemant Agrawal
2018-07-06  8:10     ` [dpdk-dev] [PATCH v3 13/16] drivers: support function name in logs trace Hemant Agrawal
2018-07-06  8:10     ` [dpdk-dev] [PATCH v3 14/16] net/dpaa: move the push queue set to global init Hemant Agrawal
2018-07-06  8:10     ` [dpdk-dev] [PATCH v3 15/16] bus/dpaa: add support for SG config Hemant Agrawal
2018-07-06  8:10     ` [dpdk-dev] [PATCH v3 16/16] net/dpaa: implement scatter offload support Hemant Agrawal
2018-07-12 12:23       ` Thomas Monjalon
2018-07-13  6:32         ` Shreyansh Jain
2018-07-12 12:49     ` [dpdk-dev] [PATCH v3 01/16] bus/dpaa: fix phandle support for kernel 4.16 Thomas Monjalon

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=1529574244-18997-5-git-send-email-hemant.agrawal@nxp.com \
    --to=hemant.agrawal@nxp.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=nipun.gupta@nxp.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).