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, Rohit Raj <rohit.raj@nxp.com>
Subject: [dpdk-dev] [PATCH 4/7] net/dpaa: add check for parsing default Rx queue
Date: Mon, 19 Jul 2021 19:29:14 +0530	[thread overview]
Message-ID: <20210719135917.26241-5-hemant.agrawal@nxp.com> (raw)
In-Reply-To: <20210719135917.26241-1-hemant.agrawal@nxp.com>

From: Rohit Raj <rohit.raj@nxp.com>

Add check for the PCD queue from the kernel interface
for default and error queues.

Signed-off-by: Rohit Raj <rohit.raj@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/bus/dpaa/base/fman/fman.c | 16 +++++++++++++++-
 drivers/bus/dpaa/include/fman.h   |  7 +++++--
 drivers/net/dpaa/dpaa_fmc.c       |  5 ++++-
 3 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/drivers/bus/dpaa/base/fman/fman.c b/drivers/bus/dpaa/base/fman/fman.c
index a14004d7fc..1814372a40 100644
--- a/drivers/bus/dpaa/base/fman/fman.c
+++ b/drivers/bus/dpaa/base/fman/fman.c
@@ -214,7 +214,7 @@ fman_if_init(const struct device_node *dpa_node)
 	const phandle *port_cell_idx, *ext_args_cell_idx;
 	const struct device_node *parent_node_ext_args;
 	uint64_t tx_phandle_host[4] = {0};
-	uint64_t rx_phandle_host[4] = {0};
+	uint64_t rx_phandle_host[6] = {0};
 	uint64_t regs_addr_host = 0;
 	uint64_t cell_idx_host = 0;
 	uint64_t port_cell_idx_val = 0;
@@ -511,6 +511,10 @@ fman_if_init(const struct device_node *dpa_node)
 		goto err;
 	}
 
+	/* Check if "fsl,qman-frame-queues-rx" in dtb file is valid entry or
+	 * not. A valid entry contains at least 4 entries, rx_error_queue,
+	 * rx_error_queue_count, fqid_rx_def and rx_error_queue_count.
+	 */
 	assert(lenp >= (4 * sizeof(phandle)));
 
 	na = of_n_addr_cells(mac_node);
@@ -519,11 +523,21 @@ fman_if_init(const struct device_node *dpa_node)
 	rx_phandle_host[1] = of_read_number(&rx_phandle[1], na);
 	rx_phandle_host[2] = of_read_number(&rx_phandle[2], na);
 	rx_phandle_host[3] = of_read_number(&rx_phandle[3], na);
+	rx_phandle_host[4] = of_read_number(&rx_phandle[4], na);
+	rx_phandle_host[5] = of_read_number(&rx_phandle[5], na);
 
 	assert((rx_phandle_host[1] == 1) && (rx_phandle_host[3] == 1));
 	__if->__if.fqid_rx_err = rx_phandle_host[0];
 	__if->__if.fqid_rx_def = rx_phandle_host[2];
 
+	/* If there are 6 entries in "fsl,qman-frame-queues-rx" in dtb file, it
+	 * means PCD queues are also available. Hence, store that information.
+	 */
+	if (lenp == 6 * sizeof(phandle)) {
+		__if->__if.fqid_rx_pcd = rx_phandle_host[4];
+		__if->__if.fqid_rx_pcd_count = rx_phandle_host[5];
+	}
+
 	/* Extract the Tx FQIDs */
 	tx_phandle = of_get_property(dpa_node,
 				     "fsl,qman-frame-queues-tx", &lenp);
diff --git a/drivers/bus/dpaa/include/fman.h b/drivers/bus/dpaa/include/fman.h
index 516c6c1515..3a6dd555a7 100644
--- a/drivers/bus/dpaa/include/fman.h
+++ b/drivers/bus/dpaa/include/fman.h
@@ -2,7 +2,7 @@
  *
  * Copyright 2010-2012 Freescale Semiconductor, Inc.
  * All rights reserved.
- * Copyright 2019-2020 NXP
+ * Copyright 2019-2021 NXP
  *
  */
 
@@ -329,8 +329,11 @@ struct fman_if {
 	uint8_t is_shared_mac;
 	/* The hard-coded FQIDs for this interface. Note: this doesn't cover
 	 * the PCD nor the "Rx default" FQIDs, which are configured via FMC
-	 * and its XML-based configuration.
+	 * and its XML-based configuration. These values are being parsed from
+	 * kernel device tree.
 	 */
+	uint32_t fqid_rx_pcd;
+	uint32_t fqid_rx_pcd_count;
 	uint32_t fqid_rx_def;
 	uint32_t fqid_rx_err;
 	uint32_t fqid_tx_err;
diff --git a/drivers/net/dpaa/dpaa_fmc.c b/drivers/net/dpaa/dpaa_fmc.c
index 0ef3622744..5195053361 100644
--- a/drivers/net/dpaa/dpaa_fmc.c
+++ b/drivers/net/dpaa/dpaa_fmc.c
@@ -243,7 +243,10 @@ static int dpaa_port_fmc_scheme_parse(struct fman_if *fif,
 			uint32_t fqid = fmc->scheme[idx].base_fqid + i;
 			int k, found = 0;
 
-			if (fqid == fif->fqid_rx_def) {
+			if (fqid == fif->fqid_rx_def ||
+			    (fqid >= fif->fqid_rx_pcd &&
+					fqid < (fif->fqid_rx_pcd +
+						fif->fqid_rx_pcd_count))) {
 				if (fif->is_shared_mac &&
 				fmc->scheme[idx].override_storage_profile &&
 				fmc->scheme[idx].storage_profile.direct &&
-- 
2.17.1


  parent reply	other threads:[~2021-07-19 14:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-19 13:59 [dpdk-dev] [PATCH 0/7] NXP DPAAx fixes and improvements Hemant Agrawal
2021-07-19 13:59 ` [dpdk-dev] [PATCH 1/7] bus/dpaa: fix to use right type of memory free Hemant Agrawal
2021-07-19 13:59 ` [dpdk-dev] [PATCH 2/7] net/dpaa: fix headroom in VSP case Hemant Agrawal
2021-07-19 13:59 ` [dpdk-dev] [PATCH 3/7] bus/dpaa: reduce syscall usages Hemant Agrawal
2021-07-19 13:59 ` Hemant Agrawal [this message]
2021-07-19 13:59 ` [dpdk-dev] [PATCH 5/7] net/dpaa2: add per thread init PMD API Hemant Agrawal
2021-09-09  7:09   ` Hemant Agrawal
2021-07-19 13:59 ` [dpdk-dev] [PATCH 6/7] net/dpaa2: add input validation Hemant Agrawal
2021-07-19 13:59 ` [dpdk-dev] [PATCH 7/7] doc: remove SDK info form individual dev guides Hemant Agrawal
2021-07-23 18:34 ` [dpdk-dev] [PATCH 0/7] NXP DPAAx fixes and improvements 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=20210719135917.26241-5-hemant.agrawal@nxp.com \
    --to=hemant.agrawal@nxp.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=rohit.raj@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).