From: Hemant Agrawal Date: Thu, 3 Sep 2020 17:17:45 +0000 (+0530) Subject: crypto/dpaa2_sec: support stats for secondary process X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=1fb9115a80854367e7a6d9ea528312752e6fc250;p=dpdk.git crypto/dpaa2_sec: support stats for secondary process 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 Signed-off-by: Hemant Agrawal Acked-by: Akhil Goyal --- diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index f480aafd01..14158a22de 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");