DPDK patches and discussions
 help / color / mirror / Atom feed
From: Hemant Agrawal <hemant.agrawal@nxp.com>
To: dev@dpdk.org
Cc: akhil.goyal@nxp.com, Nipun Gupta <nipun.gupta@nxp.com>,
	Hemant Agrawal <hemant.agrawal@nxp.com>
Subject: [dpdk-dev] [PATCH 2/2] crypto/dpaa2_sec: support stats for secondary process
Date: Thu,  3 Sep 2020 22:47:45 +0530	[thread overview]
Message-ID: <20200903171745.13985-2-hemant.agrawal@nxp.com> (raw)
In-Reply-To: <20200903171745.13985-1-hemant.agrawal@nxp.com>

DPAA2 crypto object access need availability of MCP object
pointer. In case of secondary process, we need to use local
MCP pointer instead of primary process.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
index f480aafd0..14158a22d 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
@@ -3489,7 +3489,7 @@ void dpaa2_sec_stats_get(struct rte_cryptodev *dev,
 			 struct rte_cryptodev_stats *stats)
 {
 	struct dpaa2_sec_dev_private *priv = dev->data->dev_private;
-	struct fsl_mc_io *dpseci = (struct fsl_mc_io *)priv->hw;
+	struct fsl_mc_io dpseci;
 	struct dpseci_sec_counters counters = {0};
 	struct dpaa2_sec_qp **qp = (struct dpaa2_sec_qp **)
 					dev->data->queue_pairs;
@@ -3512,7 +3512,12 @@ void dpaa2_sec_stats_get(struct rte_cryptodev *dev,
 		stats->dequeue_err_count += qp[i]->rx_vq.err_pkts;
 	}
 
-	ret = dpseci_get_sec_counters(dpseci, CMD_PRI_LOW, priv->token,
+	/* In case as secondary process access stats, MCP portal in priv-hw
+	 * may have primary process address. Need the secondary process
+	 * based MCP portal address for this object.
+	 */
+	dpseci.regs = dpaa2_get_mcp_ptr(MC_PORTAL_INDEX);
+	ret = dpseci_get_sec_counters(&dpseci, CMD_PRI_LOW, priv->token,
 				      &counters);
 	if (ret) {
 		DPAA2_SEC_ERR("SEC counters failed");
-- 
2.17.1


  reply	other threads:[~2020-09-03 17:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-03 17:17 [dpdk-dev] [PATCH 1/2] crypto/dpaa2_sec: fix to check queue pair array for null Hemant Agrawal
2020-09-03 17:17 ` Hemant Agrawal [this message]
2020-10-09 19:09 ` Akhil Goyal

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=20200903171745.13985-2-hemant.agrawal@nxp.com \
    --to=hemant.agrawal@nxp.com \
    --cc=akhil.goyal@nxp.com \
    --cc=dev@dpdk.org \
    --cc=nipun.gupta@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).