DPDK patches and discussions
 help / color / mirror / Atom feed
From: Akhil Goyal <akhil.goyal@nxp.com>
To: <dev@dpdk.org>
Cc: <pablo.de.lara.guarch@intel.com>, <hemant.agrawal@nxp.com>,
	<shreyansh.jain@nxp.com>, Akhil Goyal <akhil.goyal@nxp.com>,
	Nipun Gupta <nipun.gupta@nxp.com>
Subject: [dpdk-dev] [PATCH 4/5] bus/dpaa: support for enqueue frames of multiple queues
Date: Wed, 13 Dec 2017 19:26:58 +0530	[thread overview]
Message-ID: <20171213135659.32648-5-akhil.goyal@nxp.com> (raw)
In-Reply-To: <20171213135659.32648-1-akhil.goyal@nxp.com>

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
---
 drivers/bus/dpaa/base/qbman/qman.c        | 66 +++++++++++++++++++++++++++++++
 drivers/bus/dpaa/include/fsl_qman.h       | 14 +++++++
 drivers/bus/dpaa/rte_bus_dpaa_version.map |  1 +
 3 files changed, 81 insertions(+)

diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c
index 9faf25f..6b7cbf6 100644
--- a/drivers/bus/dpaa/base/qbman/qman.c
+++ b/drivers/bus/dpaa/base/qbman/qman.c
@@ -2082,6 +2082,72 @@ int qman_enqueue_multi(struct qman_fq *fq,
 	return sent;
 }
 
+int
+qman_enqueue_multi_fq(struct qman_fq *fq[], const struct qm_fd *fd,
+		      int frames_to_send)
+{
+	struct qman_portal *p = get_affine_portal();
+	struct qm_portal *portal = &p->p;
+
+	register struct qm_eqcr *eqcr = &portal->eqcr;
+	struct qm_eqcr_entry *eq = eqcr->cursor, *prev_eq;
+
+	u8 i, diff, old_ci, sent = 0;
+
+	/* Update the available entries if no entry is free */
+	if (!eqcr->available) {
+		old_ci = eqcr->ci;
+		eqcr->ci = qm_cl_in(EQCR_CI) & (QM_EQCR_SIZE - 1);
+		diff = qm_cyc_diff(QM_EQCR_SIZE, old_ci, eqcr->ci);
+		eqcr->available += diff;
+		if (!diff)
+			return 0;
+	}
+
+	/* try to send as many frames as possible */
+	while (eqcr->available && frames_to_send--) {
+		eq->fqid = fq[sent]->fqid_le;
+		eq->fd.opaque_addr = fd->opaque_addr;
+		eq->fd.addr = cpu_to_be40(fd->addr);
+		eq->fd.status = cpu_to_be32(fd->status);
+		eq->fd.opaque = cpu_to_be32(fd->opaque);
+
+		eq = (void *)((unsigned long)(eq + 1) &
+			(~(unsigned long)(QM_EQCR_SIZE << 6)));
+		eqcr->available--;
+		sent++;
+		fd++;
+	}
+	lwsync();
+
+	/* In order for flushes to complete faster, all lines are recorded in
+	 * 32 bit word.
+	 */
+	eq = eqcr->cursor;
+	for (i = 0; i < sent; i++) {
+		eq->__dont_write_directly__verb =
+			QM_EQCR_VERB_CMD_ENQUEUE | eqcr->vbit;
+		prev_eq = eq;
+		eq = (void *)((unsigned long)(eq + 1) &
+			(~(unsigned long)(QM_EQCR_SIZE << 6)));
+		if (unlikely((prev_eq + 1) != eq))
+			eqcr->vbit ^= QM_EQCR_VERB_VBIT;
+	}
+
+	/* We need  to flush all the lines but without load/store operations
+	 * between them
+	 */
+	eq = eqcr->cursor;
+	for (i = 0; i < sent; i++) {
+		dcbf(eq);
+		eq = (void *)((unsigned long)(eq + 1) &
+			(~(unsigned long)(QM_EQCR_SIZE << 6)));
+	}
+	/* Update cursor for the next call */
+	eqcr->cursor = eq;
+	return sent;
+}
+
 int qman_enqueue_orp(struct qman_fq *fq, const struct qm_fd *fd, u32 flags,
 		     struct qman_fq *orp, u16 orp_seqnum)
 {
diff --git a/drivers/bus/dpaa/include/fsl_qman.h b/drivers/bus/dpaa/include/fsl_qman.h
index 9090b63..6d935d8 100644
--- a/drivers/bus/dpaa/include/fsl_qman.h
+++ b/drivers/bus/dpaa/include/fsl_qman.h
@@ -1724,6 +1724,20 @@ int qman_enqueue_multi(struct qman_fq *fq,
 		       const struct qm_fd *fd,
 		int frames_to_send);
 
+/**
+ * qman_enqueue_multi_fq - Enqueue multiple frames to their respective frame
+ * queues.
+ * @fq[]: Array of frame queue objects to enqueue to
+ * @fd: pointer to first descriptor of frame to be enqueued
+ * @frames_to_send: number of frames to be sent.
+ *
+ * This API is similar to qman_enqueue_multi(), but it takes fd which needs
+ * to be processed by different frame queues.
+ */
+int
+qman_enqueue_multi_fq(struct qman_fq *fq[], const struct qm_fd *fd,
+		      int frames_to_send);
+
 typedef int (*qman_cb_precommit) (void *arg);
 
 /**
diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map
index 5fa975c..d440f91 100644
--- a/drivers/bus/dpaa/rte_bus_dpaa_version.map
+++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map
@@ -72,6 +72,7 @@ DPDK_18.02 {
 	qman_alloc_cgrid_range;
 	qman_create_cgr;
 	qman_delete_cgr;
+	qman_enqueue_multi_fq;
 	qman_query_fq_frm_cnt;
 	qman_release_cgrid_range;
 	rte_dpaa_portal_fq_close;
-- 
2.9.3

  parent reply	other threads:[~2017-12-13 14:00 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-13 13:56 [dpdk-dev] [PATCH 0/5] crypto/dpaa_sec: performance optimizations Akhil Goyal
2017-12-13 13:56 ` [dpdk-dev] [PATCH 1/5] crypto/dpaa_sec: optimize virt to phy conversion Akhil Goyal
2017-12-13 13:56 ` [dpdk-dev] [PATCH 2/5] crypto/dpaa_sec: support multiple sessions per qp Akhil Goyal
2017-12-13 13:56 ` [dpdk-dev] [PATCH 3/5] crypto/dpaa_sec: support ipsec protocol offload Akhil Goyal
2017-12-19 12:59   ` Hemant Agrawal
2017-12-13 13:56 ` Akhil Goyal [this message]
2017-12-19 11:32   ` [dpdk-dev] [PATCH 4/5] bus/dpaa: support for enqueue frames of multiple queues Hemant Agrawal
2017-12-13 13:56 ` [dpdk-dev] [PATCH 5/5] crypto/dpaa_sec: rewrite Rx/Tx path Akhil Goyal
2017-12-19 12:45   ` Hemant Agrawal
2018-01-08 11:13     ` De Lara Guarch, Pablo
2018-01-08 11:16       ` Akhil Goyal
2018-01-08 11:24         ` De Lara Guarch, Pablo
2018-01-11 11:44   ` [dpdk-dev] [PATCH v2] " Akhil Goyal
2018-01-17 16:54     ` De Lara Guarch, Pablo
2018-01-11 11:33 ` [dpdk-dev] [PATCH v2 0/3] crypto/dpaa_sec: performance optimizations Akhil Goyal
2018-01-11 11:33   ` [dpdk-dev] [PATCH v2 1/3] crypto/dpaa_sec: optimize virt to phy conversion Akhil Goyal
2018-01-11 11:33   ` [dpdk-dev] [PATCH v2 2/3] crypto/dpaa_sec: support multiple sessions per qp Akhil Goyal
2018-01-11 11:33   ` [dpdk-dev] [PATCH v2 3/3] crypto/dpaa_sec: support ipsec protocol offload Akhil Goyal
2018-01-11 14:13     ` De Lara Guarch, Pablo
2018-01-15  6:35   ` [dpdk-dev] [PATCH v3 0/3] crypto/dpaa_sec: performance optimizations Akhil Goyal
2018-01-15  6:35     ` [dpdk-dev] [PATCH v3 1/3] crypto/dpaa_sec: optimize virt to phy conversion Akhil Goyal
2018-01-15  6:35     ` [dpdk-dev] [PATCH v3 2/3] crypto/dpaa_sec: support multiple sessions per qp Akhil Goyal
2018-01-15  6:35     ` [dpdk-dev] [PATCH v3 3/3] crypto/dpaa_sec: support ipsec protocol offload Akhil Goyal
2018-01-15 14:46     ` [dpdk-dev] [PATCH v3 0/3] crypto/dpaa_sec: performance optimizations De Lara Guarch, Pablo

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=20171213135659.32648-5-akhil.goyal@nxp.com \
    --to=akhil.goyal@nxp.com \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.com \
    --cc=nipun.gupta@nxp.com \
    --cc=pablo.de.lara.guarch@intel.com \
    --cc=shreyansh.jain@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).