DPDK patches and discussions
 help / color / mirror / Atom feed
From: Hemant Agrawal <hemant.agrawal@nxp.com>
To: "dev@dpdk.org" <dev@dpdk.org>
Cc: "ferruh.yigit@intel.com" <ferruh.yigit@intel.com>,
	Shreyansh Jain <shreyansh.jain@nxp.com>,
	Akhil Goyal <akhil.goyal@nxp.com>
Subject: [dpdk-dev] [PATCH 1/4] bus/dpaa: fq lookup table saved for secondary process
Date: Tue, 26 Mar 2019 12:01:44 +0000	[thread overview]
Message-ID: <20190326115952.26278-1-hemant.agrawal@nxp.com> (raw)
Message-ID: <20190326120144.wOTCuvcCdIyeNDbqva1UTIWQ9kl84KuYaM3h-MK6EjQ@z> (raw)

From: Akhil Goyal <akhil.goyal@nxp.com>

A reference to qman_fq_lookup_table need to be saved in each
fq, so that it is retrieved while in running secondary process.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
---
 drivers/bus/dpaa/base/qbman/qman.c        | 8 +++++++-
 drivers/bus/dpaa/include/fsl_qman.h       | 6 ++++++
 drivers/bus/dpaa/rte_bus_dpaa_version.map | 7 +++++++
 drivers/net/dpaa/dpaa_ethdev.c            | 6 ++++++
 4 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c
index dc64d0896..c6f7d7bb3 100644
--- a/drivers/bus/dpaa/base/qbman/qman.c
+++ b/drivers/bus/dpaa/base/qbman/qman.c
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
  *
  * Copyright 2008-2016 Freescale Semiconductor Inc.
- * Copyright 2017 NXP
+ * Copyright 2017,2019 NXP
  *
  */
 
@@ -167,6 +167,11 @@ int qman_setup_fq_lookup_table(size_t num_entries)
 	return 0;
 }
 
+void qman_set_fq_lookup_table(void **fq_table)
+{
+	qman_fq_lookup_table = fq_table;
+}
+
 /* global structure that maintains fq object mapping */
 static DEFINE_SPINLOCK(fq_hash_table_lock);
 
@@ -1408,6 +1413,7 @@ int qman_create_fq(u32 fqid, u32 flags, struct qman_fq *fq)
 		pr_info("Find empty table entry failed\n");
 		return -ENOMEM;
 	}
+	fq->qman_fq_lookup_table = qman_fq_lookup_table;
 #endif
 	if (!(flags & QMAN_FQ_FLAG_AS_IS) || (flags & QMAN_FQ_FLAG_NO_MODIFY))
 		return 0;
diff --git a/drivers/bus/dpaa/include/fsl_qman.h b/drivers/bus/dpaa/include/fsl_qman.h
index e43841499..ef598ccff 100644
--- a/drivers/bus/dpaa/include/fsl_qman.h
+++ b/drivers/bus/dpaa/include/fsl_qman.h
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
  *
  * Copyright 2008-2012 Freescale Semiconductor, Inc.
+ * Copyright 2019 NXP
  *
  */
 
@@ -1233,6 +1234,7 @@ struct qman_fq {
 
 	struct rb_node node;
 #ifdef CONFIG_FSL_QMAN_FQ_LOOKUP
+	void **qman_fq_lookup_table;
 	u32 key;
 #endif
 };
@@ -1307,6 +1309,10 @@ struct qman_cgr {
 #define QMAN_CGR_FLAG_USE_INIT       0x00000001
 #define QMAN_CGR_MODE_FRAME          0x00000001
 
+#ifdef CONFIG_FSL_QMAN_FQ_LOOKUP
+void qman_set_fq_lookup_table(void **table);
+#endif
+
 /**
  * qman_get_portal_index - get portal configuration index
  */
diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map
index 70076c7ac..c88deaf7f 100644
--- a/drivers/bus/dpaa/rte_bus_dpaa_version.map
+++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map
@@ -116,3 +116,10 @@ DPDK_18.11 {
 
 	local: *;
 } DPDK_18.08;
+
+DPDK_19.05 {
+	global:
+	qman_set_fq_lookup_table;
+
+	local: *;
+} DPDK_18.11;
diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index ba66aa2a0..d42ac6286 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -1225,11 +1225,17 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev)
 
 	PMD_INIT_FUNC_TRACE();
 
+	dpaa_intf = eth_dev->data->dev_private;
 	/* For secondary processes, the primary has done all the work */
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
 		eth_dev->dev_ops = &dpaa_devops;
 		/* Plugging of UCODE burst API not supported in Secondary */
 		eth_dev->rx_pkt_burst = dpaa_eth_queue_rx;
+		eth_dev->tx_pkt_burst = dpaa_eth_queue_tx;
+#ifdef CONFIG_FSL_QMAN_FQ_LOOKUP
+		qman_set_fq_lookup_table(
+				dpaa_intf->rx_queues->qman_fq_lookup_table);
+#endif
 		return 0;
 	}
 
-- 
2.17.1


             reply	other threads:[~2019-03-26 12:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-26 12:01 Hemant Agrawal [this message]
2019-03-26 12:01 ` Hemant Agrawal
2019-03-26 12:01 ` [dpdk-dev] [PATCH 2/4] mempool/dpaa: bp info dynamic allocation for multiprocess Hemant Agrawal
2019-03-26 12:01   ` Hemant Agrawal
2019-03-26 12:01 ` [dpdk-dev] [PATCH 3/4] bus/dpaa: delay fman device list to bus probe Hemant Agrawal
2019-03-26 12:01   ` Hemant Agrawal
2019-03-26 12:01 ` [dpdk-dev] [PATCH 4/4] net/dpaa2: add support for flow table flush Hemant Agrawal
2019-03-26 12:01   ` Hemant Agrawal
2019-03-29 13:33 ` [dpdk-dev] [PATCH 1/4] bus/dpaa: fq lookup table saved for secondary process Thomas Monjalon
2019-03-29 13:33   ` 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=20190326115952.26278-1-hemant.agrawal@nxp.com \
    --to=hemant.agrawal@nxp.com \
    --cc=akhil.goyal@nxp.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@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).