DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/2] crypto/dpaa2_sec: fix to check queue pair array for null
@ 2020-09-03 17:17 Hemant Agrawal
  2020-09-03 17:17 ` [dpdk-dev] [PATCH 2/2] crypto/dpaa2_sec: support stats for secondary process Hemant Agrawal
  2020-10-09 19:09 ` [dpdk-dev] [PATCH 1/2] crypto/dpaa2_sec: fix to check queue pair array for null Akhil Goyal
  0 siblings, 2 replies; 3+ messages in thread
From: Hemant Agrawal @ 2020-09-03 17:17 UTC (permalink / raw)
  To: dev; +Cc: akhil.goyal, stable, Hemant Agrawal

dpdk-procinfo calls the crypto stats API, which results segmentation
fault on DPAA2_SEC.
The queue pair array will be NULL, when it is used without
configuring the SEC device.

Fixes: 02f35eee264b ("crypto/dpaa2_sec: support statistics")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
index 109e61ae1..f480aafd0 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
@@ -3501,7 +3501,7 @@ void dpaa2_sec_stats_get(struct rte_cryptodev *dev,
 		return;
 	}
 	for (i = 0; i < dev->data->nb_queue_pairs; i++) {
-		if (qp[i] == NULL) {
+		if (qp == NULL || qp[i] == NULL) {
 			DPAA2_SEC_DEBUG("Uninitialised queue pair");
 			continue;
 		}
-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [dpdk-dev] [PATCH 2/2] crypto/dpaa2_sec: support stats for secondary process
  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
  2020-10-09 19:09 ` [dpdk-dev] [PATCH 1/2] crypto/dpaa2_sec: fix to check queue pair array for null Akhil Goyal
  1 sibling, 0 replies; 3+ messages in thread
From: Hemant Agrawal @ 2020-09-03 17:17 UTC (permalink / raw)
  To: dev; +Cc: akhil.goyal, Nipun Gupta, Hemant Agrawal

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH 1/2] crypto/dpaa2_sec: fix to check queue pair array for null
  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 ` [dpdk-dev] [PATCH 2/2] crypto/dpaa2_sec: support stats for secondary process Hemant Agrawal
@ 2020-10-09 19:09 ` Akhil Goyal
  1 sibling, 0 replies; 3+ messages in thread
From: Akhil Goyal @ 2020-10-09 19:09 UTC (permalink / raw)
  To: Hemant Agrawal, dev; +Cc: stable, Hemant Agrawal

> dpdk-procinfo calls the crypto stats API, which results segmentation
> fault on DPAA2_SEC.
> The queue pair array will be NULL, when it is used without
> configuring the SEC device.
> 
> Fixes: 02f35eee264b ("crypto/dpaa2_sec: support statistics")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Series
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>

Applied to dpdk-next-crypto

Thanks.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-10-09 19:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [dpdk-dev] [PATCH 2/2] crypto/dpaa2_sec: support stats for secondary process Hemant Agrawal
2020-10-09 19:09 ` [dpdk-dev] [PATCH 1/2] crypto/dpaa2_sec: fix to check queue pair array for null Akhil Goyal

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).