DPDK patches and discussions
 help / color / mirror / Atom feed
From: Hemant Agrawal <hemant.agrawal@nxp.com>
To: dev@dpdk.org
Cc: shreyansh.jain@nxp.com
Subject: [dpdk-dev] [PATCH v3 09/16] net/dpaa: support default queue mode
Date: Fri,  6 Jul 2018 13:40:06 +0530	[thread overview]
Message-ID: <1530864613-11754-9-git-send-email-hemant.agrawal@nxp.com> (raw)
In-Reply-To: <1530864613-11754-1-git-send-email-hemant.agrawal@nxp.com>

In case DPAA FMAN configuration tool (FMC) is not available,
the system can still work with default queue(1 queue per port).

This patch also fixes some logs related to FQ ids, which were
idetified while testing this support.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/net/dpaa/dpaa_ethdev.c | 37 ++++++++++++++++++++++++++-----------
 1 file changed, 26 insertions(+), 11 deletions(-)

diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index 79ba6bd..def9483 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -74,6 +74,7 @@ static uint64_t dev_tx_offloads_nodis =
 
 /* Keep track of whether QMAN and BMAN have been globally initialized */
 static int is_global_init;
+static int default_q;	/* use default queue - FMC is not executed*/
 /* At present we only allow up to 4 push mode queues as default - as each of
  * this queue need dedicated portal and we are short of portals.
  */
@@ -1026,12 +1027,12 @@ static int dpaa_rx_queue_init(struct qman_fq *fq, struct qman_cgr *cgr_rx,
 
 	ret = qman_reserve_fqid(fqid);
 	if (ret) {
-		DPAA_PMD_ERR("reserve rx fqid %d failed with ret: %d",
+		DPAA_PMD_ERR("reserve rx fqid 0x%x failed with ret: %d",
 			     fqid, ret);
 		return -EINVAL;
 	}
 
-	DPAA_PMD_DEBUG("creating rx fq %p, fqid %d", fq, fqid);
+	DPAA_PMD_DEBUG("creating rx fq %p, fqid 0x%x", fq, fqid);
 	ret = qman_create_fq(fqid, QMAN_FQ_FLAG_NO_ENQUEUE, fq);
 	if (ret) {
 		DPAA_PMD_ERR("create rx fqid 0x%x failed with ret: %d",
@@ -1050,7 +1051,7 @@ static int dpaa_rx_queue_init(struct qman_fq *fq, struct qman_cgr *cgr_rx,
 				      &cgr_opts);
 		if (ret) {
 			DPAA_PMD_WARN(
-				"rx taildrop init fail on rx fqid %d (ret=%d)",
+				"rx taildrop init fail on rx fqid 0x%x(ret=%d)",
 				fqid, ret);
 			goto without_cgr;
 		}
@@ -1061,7 +1062,7 @@ static int dpaa_rx_queue_init(struct qman_fq *fq, struct qman_cgr *cgr_rx,
 without_cgr:
 	ret = qman_init_fq(fq, flags, &opts);
 	if (ret)
-		DPAA_PMD_ERR("init rx fqid %d failed with ret: %d", fqid, ret);
+		DPAA_PMD_ERR("init rx fqid 0x%x failed with ret:%d", fqid, ret);
 	return ret;
 }
 
@@ -1089,10 +1090,10 @@ static int dpaa_tx_queue_init(struct qman_fq *fq,
 	/* no tx-confirmation */
 	opts.fqd.context_a.hi = 0x80000000 | fman_dealloc_bufs_mask_hi;
 	opts.fqd.context_a.lo = 0 | fman_dealloc_bufs_mask_lo;
-	DPAA_PMD_DEBUG("init tx fq %p, fqid %d", fq, fq->fqid);
+	DPAA_PMD_DEBUG("init tx fq %p, fqid 0x%x", fq, fq->fqid);
 	ret = qman_init_fq(fq, QMAN_INITFQ_FLAG_SCHED, &opts);
 	if (ret)
-		DPAA_PMD_ERR("init tx fqid %d failed %d", fq->fqid, ret);
+		DPAA_PMD_ERR("init tx fqid 0x%x failed %d", fq->fqid, ret);
 	return ret;
 }
 
@@ -1163,10 +1164,15 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev)
 	dpaa_intf->cfg = cfg;
 
 	/* Initialize Rx FQ's */
-	if (getenv("DPAA_NUM_RX_QUEUES"))
-		num_rx_fqs = atoi(getenv("DPAA_NUM_RX_QUEUES"));
-	else
+	if (default_q) {
 		num_rx_fqs = DPAA_DEFAULT_NUM_PCD_QUEUES;
+	} else {
+		if (getenv("DPAA_NUM_RX_QUEUES"))
+			num_rx_fqs = atoi(getenv("DPAA_NUM_RX_QUEUES"));
+		else
+			num_rx_fqs = DPAA_DEFAULT_NUM_PCD_QUEUES;
+	}
+
 
 	/* if push mode queues to be enabled. Currenly we are allowing only
 	 * one queue per thread.
@@ -1214,8 +1220,11 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev)
 	}
 
 	for (loop = 0; loop < num_rx_fqs; loop++) {
-		fqid = DPAA_PCD_FQID_START + dpaa_intf->ifid *
-			DPAA_PCD_FQID_MULTIPLIER + loop;
+		if (default_q)
+			fqid = cfg->rx_def;
+		else
+			fqid = DPAA_PCD_FQID_START + dpaa_intf->ifid *
+				DPAA_PCD_FQID_MULTIPLIER + loop;
 
 		if (dpaa_intf->cgr_rx)
 			dpaa_intf->cgr_rx[loop].cgrid = cgrid[loop];
@@ -1409,6 +1418,12 @@ rte_dpaa_probe(struct rte_dpaa_driver *dpaa_drv,
 			return ret;
 		}
 
+		if (access("/tmp/fmc.bin", F_OK) == -1) {
+			RTE_LOG(INFO, PMD,
+				"* FMC not configured.Enabling default mode\n");
+			default_q = 1;
+		}
+
 		is_global_init = 1;
 	}
 
-- 
2.7.4

  parent reply	other threads:[~2018-07-06  8:12 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 ` [dpdk-dev] [PATCH 05/10] bus/dpaa: make vdqcr configurable Hemant Agrawal
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     ` Hemant Agrawal [this message]
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=1530864613-11754-9-git-send-email-hemant.agrawal@nxp.com \
    --to=hemant.agrawal@nxp.com \
    --cc=dev@dpdk.org \
    --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).