crypto/dpaa2_sec: support stats for secondary process
authorHemant Agrawal <hemant.agrawal@nxp.com>
Thu, 3 Sep 2020 17:17:45 +0000 (22:47 +0530)
committerAkhil Goyal <akhil.goyal@nxp.com>
Wed, 14 Oct 2020 20:22:06 +0000 (22:22 +0200)
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>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c

index f480aaf..14158a2 100644 (file)
@@ -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");