DPDK patches and discussions
 help / color / mirror / Atom feed
From: Nipun Gupta <nipun.gupta@nxp.com>
To: <jerin.jacob@caviumnetworks.com>
Cc: <dev@dpdk.org>, <hemant.agrawal@nxp.com>,
	Nipun Gupta <nipun.gupta@nxp.com>
Subject: [dpdk-dev] [PATCH 5/6 v3] bus/fslmc: add flag to configure DCA in QBMAN multi Tx
Date: Wed, 17 Jan 2018 17:09:13 +0530	[thread overview]
Message-ID: <1516189154-28331-6-git-send-email-nipun.gupta@nxp.com> (raw)
In-Reply-To: <1516189154-28331-1-git-send-email-nipun.gupta@nxp.com>

With the current QBMAN multi-tx API, we need to create separate
enqueue descriptors for each of the packet which is required to
be enqueued to the hardware, once we support Atomic Queues
(with DCA) in dpaa2 drivers. Creating enqueue descriptor for
each packet is costly and have significant performance impact.
This patch introduces a flag parameter in the QBMAN multi-tx API,
so that DCA configuration (and later on ORP/ODP for ordered queues)
can be passed using flags and be updated in the EQCR using this flag.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h | 5 +++++
 drivers/bus/fslmc/qbman/qbman_portal.c             | 7 +++++++
 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c        | 1 +
 drivers/net/dpaa2/dpaa2_rxtx.c                     | 6 ++++--
 4 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h b/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h
index 10f38ca..95d785f 100644
--- a/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h
+++ b/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h
@@ -566,6 +566,9 @@ static inline int qbman_result_is_SCN(const struct qbman_result *dq)
 /* volatile dequeue command is expired */
 #define QBMAN_DQ_STAT_EXPIRED       0x01
 
+#define QBMAN_EQCR_DCA_IDXMASK		0x0f
+#define QBMAN_ENQUEUE_FLAG_DCA		(1ULL << 31)
+
 /**
  * qbman_result_DQ_flags() - Get the STAT field of dequeue response
  * @dq: the dequeue result.
@@ -956,6 +959,7 @@ int qbman_swp_enqueue(struct qbman_swp *s, const struct qbman_eq_desc *d,
 int qbman_swp_enqueue_multiple(struct qbman_swp *s,
 			       const struct qbman_eq_desc *d,
 			       const struct qbman_fd *fd,
+			       uint32_t *flags,
 			       int num_frames);
 /**
  * qbman_swp_enqueue_multiple_desc() - Enqueue multiple frames with
@@ -963,6 +967,7 @@ int qbman_swp_enqueue_multiple(struct qbman_swp *s,
  * @s: the software portal used for enqueue.
  * @d: the enqueue descriptor.
  * @fd: the frame descriptor to be enqueued.
+ * @flags: bit-mask of QBMAN_ENQUEUE_FLAG_*** options
  * @num_frames: the number of the frames to be enqueued.
  *
  * Return the number of enqueued frames, -EBUSY if the EQCR is not ready.
diff --git a/drivers/bus/fslmc/qbman/qbman_portal.c b/drivers/bus/fslmc/qbman/qbman_portal.c
index b02dfa2..2d324f7 100644
--- a/drivers/bus/fslmc/qbman/qbman_portal.c
+++ b/drivers/bus/fslmc/qbman/qbman_portal.c
@@ -496,6 +496,7 @@ int qbman_swp_enqueue(struct qbman_swp *s, const struct qbman_eq_desc *d,
 int qbman_swp_enqueue_multiple(struct qbman_swp *s,
 			       const struct qbman_eq_desc *d,
 			       const struct qbman_fd *fd,
+			       uint32_t *flags,
 			       int num_frames)
 {
 	uint32_t *p;
@@ -538,6 +539,12 @@ int qbman_swp_enqueue_multiple(struct qbman_swp *s,
 		p = qbman_cena_write_start_wo_shadow(&s->sys,
 					QBMAN_CENA_SWP_EQCR(eqcr_pi & 7));
 		p[0] = cl[0] | s->eqcr.pi_vb;
+		if (flags && (flags[i] & QBMAN_ENQUEUE_FLAG_DCA)) {
+			struct qbman_eq_desc *d = (struct qbman_eq_desc *)p;
+
+			d->eq.dca = (1 << QB_ENQUEUE_CMD_DCA_EN_SHIFT) |
+				((flags[i]) & QBMAN_EQCR_DCA_IDXMASK);
+		}
 		eqcr_pi++;
 		eqcr_pi &= 0xF;
 		if (!(eqcr_pi & 7))
diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
index 977c49a..a67d979 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
@@ -673,6 +673,7 @@
 		while (loop < frames_to_send) {
 			loop += qbman_swp_enqueue_multiple(swp, &eqdesc,
 							&fd_arr[loop],
+							NULL,
 							frames_to_send - loop);
 		}
 
diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c
index 53466c3..c43e3a1 100644
--- a/drivers/net/dpaa2/dpaa2_rxtx.c
+++ b/drivers/net/dpaa2/dpaa2_rxtx.c
@@ -761,7 +761,8 @@ void __attribute__((hot))
 		loop = 0;
 		while (loop < frames_to_send) {
 			loop += qbman_swp_enqueue_multiple(swp, &eqdesc,
-					&fd_arr[loop], frames_to_send - loop);
+					&fd_arr[loop], NULL,
+					frames_to_send - loop);
 		}
 
 		num_tx += frames_to_send;
@@ -777,7 +778,8 @@ void __attribute__((hot))
 
 		while (i < loop) {
 			i += qbman_swp_enqueue_multiple(swp, &eqdesc,
-							&fd_arr[i], loop - i);
+							&fd_arr[i], NULL,
+							loop - i);
 		}
 		num_tx += loop;
 	}
-- 
1.9.1

  parent reply	other threads:[~2018-01-17  5:24 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-12 21:22 [dpdk-dev] [PATCH 0/6 v2] support atomic queues in dpaa2 ethernet with eventdev Nipun Gupta
2018-01-12 21:22 ` [dpdk-dev] [PATCH 1/6 v2] event/dpaa2: replace static with dynamic logging Nipun Gupta
2018-01-12 15:29   ` Hemant Agrawal
2018-01-17  3:50     ` Nipun Gupta
2018-01-18  6:37     ` Jerin Jacob
2018-01-12 21:22 ` [dpdk-dev] [PATCH 2/6 v2] bus/fslmc: introduce API to consume dqrr using index Nipun Gupta
2018-01-12 21:22 ` [dpdk-dev] [PATCH 3/6 v2] event/dpaa2: use dqrr index to cosume the DQRR entry Nipun Gupta
2018-01-12 21:22 ` [dpdk-dev] [PATCH 4/6 v2] event/dpaa2: have separate structure to hold dqrr entries Nipun Gupta
2018-01-12 21:23 ` [dpdk-dev] [PATCH 5/6 v2] bus/fslmc: add flag to configure DCA in QBMAN multi Tx Nipun Gupta
2018-01-12 21:23 ` [dpdk-dev] [PATCH 6/6 v2] net/dpaa2: support atomic queues Nipun Gupta
2018-01-17 11:39 ` [dpdk-dev] [PATCH 0/6 v3] support atomic queues in dpaa2 ethernet with eventdev Nipun Gupta
2018-01-17 11:39   ` [dpdk-dev] [PATCH 1/6 v3] event/dpaa2: replace static with dynamic logging Nipun Gupta
2018-01-17 11:39   ` [dpdk-dev] [PATCH 2/6 v3] bus/fslmc: introduce API to consume dqrr using index Nipun Gupta
2018-01-17 11:39   ` [dpdk-dev] [PATCH 3/6 v3] event/dpaa2: use dqrr index to cosume the DQRR entry Nipun Gupta
2018-01-17 11:39   ` [dpdk-dev] [PATCH 4/6 v3] event/dpaa2: have separate structure to hold dqrr entries Nipun Gupta
2018-01-17 11:39   ` Nipun Gupta [this message]
2018-01-17 11:39   ` [dpdk-dev] [PATCH 6/6 v3] net/dpaa2: support atomic queues Nipun Gupta

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=1516189154-28331-6-git-send-email-nipun.gupta@nxp.com \
    --to=nipun.gupta@nxp.com \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.com \
    --cc=jerin.jacob@caviumnetworks.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).