[2/2] crypto/dpaa2_sec: support stats for secondary process
diff mbox series

Message ID 20200903171745.13985-2-hemant.agrawal@nxp.com
State Accepted
Delegated to: akhil goyal
Headers show
Series
  • [1/2] crypto/dpaa2_sec: fix to check queue pair array for null
Related show

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/travis-robot success Travis build: passed
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS

Commit Message

Hemant Agrawal Sept. 3, 2020, 5:17 p.m. UTC
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(-)

Patch
diff mbox series

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");