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>, Sunil Kumar Kori <sunil.kori@nxp.com>
Subject: [dpdk-dev] [PATCH 17/18] bus/dpaa: add support for static queues
Date: Wed, 13 Dec 2017 17:35:58 +0530	[thread overview]
Message-ID: <1513166759-13466-18-git-send-email-hemant.agrawal@nxp.com> (raw)
In-Reply-To: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com>

DPAA hardware support two kinds of queues:
1. Pull mode queue - where one needs to regularly pull the packets.
2. Push mode queue - where the hw pushes the packet to queue. These are
   high performance queues, but limitd in number.

This patch add the driver support for push m de queues.

Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/bus/dpaa/base/qbman/qman.c        | 64 +++++++++++++++++++++++++++++++
 drivers/bus/dpaa/base/qbman/qman.h        |  4 +-
 drivers/bus/dpaa/include/fsl_qman.h       | 10 +++++
 drivers/bus/dpaa/rte_bus_dpaa_version.map |  2 +
 4 files changed, 78 insertions(+), 2 deletions(-)

diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c
index b2f82a3..42d509d 100644
--- a/drivers/bus/dpaa/base/qbman/qman.c
+++ b/drivers/bus/dpaa/base/qbman/qman.c
@@ -1080,6 +1080,70 @@ u16 qman_affine_channel(int cpu)
 	return affine_channels[cpu];
 }
 
+unsigned int qman_portal_poll_rx(unsigned int poll_limit,
+				 void **bufs,
+				 struct qman_portal *p)
+{
+	const struct qm_dqrr_entry *dq;
+	struct qman_fq *fq;
+	enum qman_cb_dqrr_result res;
+	unsigned int limit = 0;
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+	struct qm_dqrr_entry *shadow;
+#endif
+	unsigned int rx_number = 0;
+
+	do {
+		qm_dqrr_pvb_update(&p->p);
+		dq = qm_dqrr_current(&p->p);
+		if (unlikely(!dq))
+			break;
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+	/* If running on an LE system the fields of the
+	 * dequeue entry must be swapper.  Because the
+	 * QMan HW will ignore writes the DQRR entry is
+	 * copied and the index stored within the copy
+	 */
+		shadow = &p->shadow_dqrr[DQRR_PTR2IDX(dq)];
+		*shadow = *dq;
+		dq = shadow;
+		shadow->fqid = be32_to_cpu(shadow->fqid);
+		shadow->contextB = be32_to_cpu(shadow->contextB);
+		shadow->seqnum = be16_to_cpu(shadow->seqnum);
+		hw_fd_to_cpu(&shadow->fd);
+#endif
+
+		/* SDQCR: context_b points to the FQ */
+#ifdef CONFIG_FSL_QMAN_FQ_LOOKUP
+		fq = get_fq_table_entry(dq->contextB);
+#else
+		fq = (void *)(uintptr_t)dq->contextB;
+#endif
+		/* Now let the callback do its stuff */
+		res = fq->cb.dqrr_dpdk_cb(NULL, p, fq, dq, &bufs[rx_number]);
+		rx_number++;
+		/* Interpret 'dq' from a driver perspective. */
+		/*
+		 * Parking isn't possible unless HELDACTIVE was set. NB,
+		 * FORCEELIGIBLE implies HELDACTIVE, so we only need to
+		 * check for HELDACTIVE to cover both.
+		 */
+		DPAA_ASSERT((dq->stat & QM_DQRR_STAT_FQ_HELDACTIVE) ||
+			    (res != qman_cb_dqrr_park));
+		qm_dqrr_cdc_consume_1ptr(&p->p, dq, res == qman_cb_dqrr_park);
+		/* Move forward */
+		qm_dqrr_next(&p->p);
+		/*
+		 * Entry processed and consumed, increment our counter.  The
+		 * callback can request that we exit after consuming the
+		 * entry, and we also exit if we reach our processing limit,
+		 * so loop back only if neither of these conditions is met.
+		 */
+	} while (likely(++limit < poll_limit));
+
+	return limit;
+}
+
 struct qm_dqrr_entry *qman_dequeue(struct qman_fq *fq)
 {
 	struct qman_portal *p = get_affine_portal();
diff --git a/drivers/bus/dpaa/base/qbman/qman.h b/drivers/bus/dpaa/base/qbman/qman.h
index 2c0f694..999e429 100644
--- a/drivers/bus/dpaa/base/qbman/qman.h
+++ b/drivers/bus/dpaa/base/qbman/qman.h
@@ -187,7 +187,7 @@ struct qm_eqcr {
 };
 
 struct qm_dqrr {
-	const struct qm_dqrr_entry *ring, *cursor;
+	struct qm_dqrr_entry *ring, *cursor;
 	u8 pi, ci, fill, ithresh, vbit;
 #ifdef RTE_LIBRTE_DPAA_HWDEBUG
 	enum qm_dqrr_dmode dmode;
@@ -460,7 +460,7 @@ static inline u8 DQRR_PTR2IDX(const struct qm_dqrr_entry *e)
 	return ((uintptr_t)e >> 6) & (QM_DQRR_SIZE - 1);
 }
 
-static inline const struct qm_dqrr_entry *DQRR_INC(
+static inline struct qm_dqrr_entry *DQRR_INC(
 						const struct qm_dqrr_entry *e)
 {
 	return DQRR_CARRYCLEAR(e + 1);
diff --git a/drivers/bus/dpaa/include/fsl_qman.h b/drivers/bus/dpaa/include/fsl_qman.h
index 9090b63..7ec07ee 100644
--- a/drivers/bus/dpaa/include/fsl_qman.h
+++ b/drivers/bus/dpaa/include/fsl_qman.h
@@ -1157,6 +1157,12 @@ typedef enum qman_cb_dqrr_result (*qman_cb_dqrr)(struct qman_portal *qm,
 					struct qman_fq *fq,
 					const struct qm_dqrr_entry *dqrr);
 
+typedef enum qman_cb_dqrr_result (*qman_dpdk_cb_dqrr)(void *event,
+					struct qman_portal *qm,
+					struct qman_fq *fq,
+					const struct qm_dqrr_entry *dqrr,
+					void **bd);
+
 /*
  * This callback type is used when handling ERNs, FQRNs and FQRLs via MR. They
  * are always consumed after the callback returns.
@@ -1215,6 +1221,7 @@ enum qman_fq_state {
  */
 
 struct qman_fq_cb {
+	qman_dpdk_cb_dqrr dqrr_dpdk_cb;	/* for dequeued frames */
 	qman_cb_dqrr dqrr;	/* for dequeued frames */
 	qman_cb_mr ern;		/* for s/w ERNs */
 	qman_cb_mr fqs;		/* frame-queue state changes*/
@@ -1332,6 +1339,9 @@ int qman_get_portal_index(void);
  */
 u16 qman_affine_channel(int cpu);
 
+unsigned int qman_portal_poll_rx(unsigned int poll_limit,
+				 void **bufs, struct qman_portal *q);
+
 /**
  * qman_set_vdq - Issue a volatile dequeue command
  * @fq: Frame Queue on which the volatile dequeue command is issued
diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map
index 212c75f..460cfbf 100644
--- a/drivers/bus/dpaa/rte_bus_dpaa_version.map
+++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map
@@ -70,9 +70,11 @@ DPDK_18.02 {
 
 	dpaa_svr_family;
 	qman_alloc_cgrid_range;
+	qman_alloc_pool_range;
 	qman_create_cgr;
 	qman_delete_cgr;
 	qman_modify_cgr;
+	qman_portal_poll_rx;
 	qman_query_fq_frm_cnt;
 	qman_release_cgrid_range;
 	rte_dpaa_portal_fq_close;
-- 
2.7.4

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

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-13 12:05 [dpdk-dev] [PATCH 00/18] DPAA PMD improvements Hemant Agrawal
2017-12-13 12:05 ` [dpdk-dev] [PATCH 01/18] net/dpaa: fix coverity reported issues Hemant Agrawal
2018-01-09 10:46   ` Ferruh Yigit
2018-01-09 13:29     ` Hemant Agrawal
2017-12-13 12:05 ` [dpdk-dev] [PATCH 02/18] net/dpaa: fix the mbuf packet type if zero Hemant Agrawal
2017-12-13 12:05 ` [dpdk-dev] [PATCH 03/18] net/dpaa: fix FW version code Hemant Agrawal
2017-12-13 12:05 ` [dpdk-dev] [PATCH 04/18] bus/dpaa: update platform soc value register routines Hemant Agrawal
2017-12-13 12:05 ` [dpdk-dev] [PATCH 05/18] net/dpaa: set the correct frame size in device MTU Hemant Agrawal
2018-01-09 10:46   ` Ferruh Yigit
2017-12-13 12:05 ` [dpdk-dev] [PATCH 06/18] net/dpaa: add frame count based tail drop with CGR Hemant Agrawal
2017-12-13 12:05 ` [dpdk-dev] [PATCH 07/18] bus/dpaa: optimize the qman HW stashing settings Hemant Agrawal
2017-12-13 12:05 ` [dpdk-dev] [PATCH 08/18] bus/dpaa: optimize the endianness conversions Hemant Agrawal
2017-12-13 12:05 ` [dpdk-dev] [PATCH 09/18] bus/dpaa: add support to create dynamic HW portal Hemant Agrawal
2017-12-13 12:05 ` [dpdk-dev] [PATCH 10/18] net/dpaa: change Tx HW budget to 7 Hemant Agrawal
2017-12-13 12:05 ` [dpdk-dev] [PATCH 11/18] net/dpaa: optimize the Tx burst Hemant Agrawal
2017-12-13 12:05 ` [dpdk-dev] [PATCH 12/18] net/dpaa: optimize Rx path Hemant Agrawal
2017-12-13 12:05 ` [dpdk-dev] [PATCH 13/18] bus/dpaa: query queue frame count support Hemant Agrawal
2017-12-13 12:05 ` [dpdk-dev] [PATCH 14/18] net/dpaa: add Rx queue " Hemant Agrawal
2017-12-13 12:05 ` [dpdk-dev] [PATCH 15/18] net/dpaa: add support for loopback API Hemant Agrawal
2018-01-09 10:46   ` Ferruh Yigit
2017-12-13 12:05 ` [dpdk-dev] [PATCH 16/18] app/testpmd: add support for loopback config for dpaa Hemant Agrawal
2017-12-13 12:05 ` Hemant Agrawal [this message]
2018-01-09 10:46   ` [dpdk-dev] [PATCH 17/18] bus/dpaa: add support for static queues Ferruh Yigit
2017-12-13 12:05 ` [dpdk-dev] [PATCH 18/18] net/dpaa: integrate the support of push mode in PMD Hemant Agrawal
2018-01-09 10:47 ` [dpdk-dev] [PATCH 00/18] DPAA PMD improvements Ferruh Yigit
2018-01-09 13:22 ` [dpdk-dev] [PATCH v2 " Hemant Agrawal
2018-01-09 13:22   ` [dpdk-dev] [PATCH v2 01/18] net/dpaa: fix the mbuf packet type if zero Hemant Agrawal
2018-01-09 13:22   ` [dpdk-dev] [PATCH v2 02/18] net/dpaa: fix FW version code Hemant Agrawal
2018-01-09 13:22   ` [dpdk-dev] [PATCH v2 03/18] bus/dpaa: update platform soc value register routines Hemant Agrawal
2018-01-09 13:22   ` [dpdk-dev] [PATCH v2 04/18] net/dpaa: set the correct frame size in device MTU Hemant Agrawal
2018-01-09 13:22   ` [dpdk-dev] [PATCH v2 05/18] net/dpaa: add frame count based tail drop with CGR Hemant Agrawal
2018-01-09 13:22   ` [dpdk-dev] [PATCH v2 06/18] bus/dpaa: optimize the qman HW stashing settings Hemant Agrawal
2018-01-09 13:22   ` [dpdk-dev] [PATCH v2 07/18] bus/dpaa: optimize the endianness conversions Hemant Agrawal
2018-01-09 13:22   ` [dpdk-dev] [PATCH v2 08/18] bus/dpaa: add support to create dynamic HW portal Hemant Agrawal
2018-01-09 13:22   ` [dpdk-dev] [PATCH v2 09/18] net/dpaa: change Tx HW budget to 7 Hemant Agrawal
2018-01-09 13:22   ` [dpdk-dev] [PATCH v2 10/18] net/dpaa: optimize the Tx burst Hemant Agrawal
2018-01-09 13:22   ` [dpdk-dev] [PATCH v2 11/18] net/dpaa: optimize Rx path Hemant Agrawal
2018-01-09 13:23   ` [dpdk-dev] [PATCH v2 12/18] bus/dpaa: query queue frame count support Hemant Agrawal
2018-01-09 13:23   ` [dpdk-dev] [PATCH v2 13/18] net/dpaa: add Rx queue " Hemant Agrawal
2018-01-09 13:23   ` [dpdk-dev] [PATCH v2 14/18] net/dpaa: add support for loopback API Hemant Agrawal
2018-01-09 13:23   ` [dpdk-dev] [PATCH v2 15/18] app/testpmd: add support for loopback config for dpaa Hemant Agrawal
2018-01-09 13:23   ` [dpdk-dev] [PATCH v2 16/18] bus/dpaa: add support for static queues Hemant Agrawal
2018-01-09 13:23   ` [dpdk-dev] [PATCH v2 17/18] net/dpaa: integrate the support of push mode in PMD Hemant Agrawal
2018-01-09 13:23   ` [dpdk-dev] [PATCH v2 18/18] bus/dpaa: support for enqueue frames of multiple queues Hemant Agrawal
2018-01-10 10:46   ` [dpdk-dev] [PATCH v3 00/19 ]DPAA PMD improvements Hemant Agrawal
2018-01-10 10:46     ` [dpdk-dev] [PATCH v3 01/19] net/dpaa: fix uninitialized and unused variables Hemant Agrawal
2018-01-10 10:46     ` [dpdk-dev] [PATCH v3 02/19] net/dpaa: fix the mbuf packet type if zero Hemant Agrawal
2018-01-10 10:46     ` [dpdk-dev] [PATCH v3 03/19] net/dpaa: fix FW version code Hemant Agrawal
2018-01-10 10:46     ` [dpdk-dev] [PATCH v3 04/19] bus/dpaa: update platform soc value register routines Hemant Agrawal
2018-01-10 10:46     ` [dpdk-dev] [PATCH v3 05/19] net/dpaa: set the correct frame size in device MTU Hemant Agrawal
2018-01-10 10:46     ` [dpdk-dev] [PATCH v3 06/19] net/dpaa: add frame count based tail drop with CGR Hemant Agrawal
2018-01-10 10:46     ` [dpdk-dev] [PATCH v3 07/19] bus/dpaa: optimize the qman HW stashing settings Hemant Agrawal
2018-01-10 10:46     ` [dpdk-dev] [PATCH v3 08/19] bus/dpaa: optimize the endianness conversions Hemant Agrawal
2018-01-10 10:46     ` [dpdk-dev] [PATCH v3 09/19] bus/dpaa: add support to create dynamic HW portal Hemant Agrawal
2018-01-10 10:46     ` [dpdk-dev] [PATCH v3 10/19] net/dpaa: change Tx HW budget to 7 Hemant Agrawal
2018-01-10 10:46     ` [dpdk-dev] [PATCH v3 11/19] net/dpaa: optimize the Tx burst Hemant Agrawal
2018-01-10 10:46     ` [dpdk-dev] [PATCH v3 12/19] net/dpaa: optimize Rx path Hemant Agrawal
2018-01-10 10:46     ` [dpdk-dev] [PATCH v3 13/19] bus/dpaa: query queue frame count support Hemant Agrawal
2018-01-10 10:46     ` [dpdk-dev] [PATCH v3 14/19] net/dpaa: add Rx queue " Hemant Agrawal
2018-01-10 10:46     ` [dpdk-dev] [PATCH v3 15/19] net/dpaa: add support for loopback API Hemant Agrawal
2018-01-10 10:46     ` [dpdk-dev] [PATCH v3 16/19] app/testpmd: add support for loopback config for dpaa Hemant Agrawal
2018-01-10 10:46     ` [dpdk-dev] [PATCH v3 17/19] bus/dpaa: add support for static queues Hemant Agrawal
2018-01-10 10:46     ` [dpdk-dev] [PATCH v3 18/19] net/dpaa: integrate the support of push mode in PMD Hemant Agrawal
2018-01-10 10:46     ` [dpdk-dev] [PATCH v3 19/19] bus/dpaa: support for enqueue frames of multiple queues Hemant Agrawal
2018-01-10 20:14     ` [dpdk-dev] [PATCH v3 00/19 ]DPAA PMD improvements Ferruh Yigit

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=1513166759-13466-18-git-send-email-hemant.agrawal@nxp.com \
    --to=hemant.agrawal@nxp.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=sunil.kori@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).