From patchwork Thu Sep 3 17:17:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 249034 Delivered-To: patch@linaro.org Received: by 2002:a17:906:6447:0:0:0:0 with SMTP id l7csp629846ejn; Thu, 3 Sep 2020 10:24:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTSajdQmSmN70gi+sRAdS6gL1rpTcuf+8SAb7V3amgP4iTAGxigTdoMAi8RUn9X3CJDOG9 X-Received: by 2002:a17:906:370a:: with SMTP id d10mr3372905ejc.393.1599153841243; Thu, 03 Sep 2020 10:24:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599153841; cv=none; d=google.com; s=arc-20160816; b=JOFa+KRnGBbVY6XuXG5bt9gTi6bN7aP4xDAyQeAI/LLL6yEbiudTxI3BTNGfNXL81Z 1CHtWM2e3jb16xhlwZ1f+NI/HMi9fs43d5Ss3OOVnCIY06M3M76RG7YUzEBS274f4Zc4 TYiGMjBJOxDadG8cRA8o6Jj3dgmjvovI/4MhcOiSMcRoBuSpfQiWxoxWchkAUkE5ognl gdUgsn1I2de1i0AI6ph2KYQy8pm6hv1VHH1G6Oy2k0eywWBbImv2Nm8D0rqJO+Ukn2A+ /glUuT5waNrsoRnPke0+8QG58vFMMwp/uZkEEYbOXab9XG+PWwQGCHW/j6Zp2fufrRyY +qnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:message-id:date:cc:to :from; bh=JMtnN8SE4yl2Obg0AMxcZ8IYpQwws+FNHTl2LbTelOc=; b=OqUuy8OuFwOLQVAELFQboaKi+nnIMLnhye/ZUJ3AcxckUy9jzAlUFpAmoyNa5+HXKt NHh9NJ/1DIymMRt7oIyDNbxe8IKQgDG/VoVZ+8vWVlBqWdhKVpvXse6zK9xF7BV6RbIM r6OPo/S1wKv+usV0fqwhpM1yA5RgeACLx+XwZmD7PRlmsFvoHnM9bmIDBgO34gO53PDM HmAuBJ4zuFQW8Zi17dqcNGZcFxjffTK94mWviI2rGXZcw+lU5mBjjk3qSMJtA4hmxbPA 0fcCmvP7urGrO27Ar+Qz6qOwtY8v/gVQvS9VPeTwz0Oo5i2zdik1fLJut72RzScFHTOi UgFw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id df8si2012803edb.237.2020.09.03.10.24.00; Thu, 03 Sep 2020 10:24:01 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 394C61C0B5; Thu, 3 Sep 2020 19:24:00 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 29386E07; Thu, 3 Sep 2020 19:23:59 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id E0C5D200215; Thu, 3 Sep 2020 19:23:58 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id D347E2002AD; Thu, 3 Sep 2020 19:23:56 +0200 (CEST) Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.133.63]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id D97E7402DD; Thu, 3 Sep 2020 19:23:53 +0200 (CEST) From: Hemant Agrawal To: dev@dpdk.org Cc: akhil.goyal@nxp.com, stable@dpdk.org, Hemant Agrawal Date: Thu, 3 Sep 2020 22:47:44 +0530 Message-Id: <20200903171745.13985-1-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 1/2] crypto/dpaa2_sec: fix to check queue pair array for null X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 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 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; } From patchwork Thu Sep 3 17:17:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 249035 Delivered-To: patch@linaro.org Received: by 2002:a17:906:6447:0:0:0:0 with SMTP id l7csp629921ejn; Thu, 3 Sep 2020 10:24:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtoyWfDkXfS+z6MR3T+4jUIh16QRF9Zab+aTZcf9XRqzAjECiCJSf4E+76O2R6pjhtuScj X-Received: by 2002:a50:bb65:: with SMTP id y92mr4209387ede.53.1599153848746; Thu, 03 Sep 2020 10:24:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599153848; cv=none; d=google.com; s=arc-20160816; b=H0SEzfv6LP51A98EYlr461NrNzWKaGqDpuFYqv1L1KbgnsE0AxHIXan4UEADFynxL1 tHMqCmSAMSZf+YKDCkwvSzwGGPWtQ9hRYzL2aMYEvaR6zzd80sUyB361Lv6ZWHghaxqy Br+ni3mlcd61/QoP+llBbRKMQdhM7AxnR6kn9mS2gChWBTo/wgZQHM90+Sz6HAfs9olZ jiAqePrVNEzFbtbPWB7FKAUdzYd4FE9uB8KPPCPdyTO2f0Jb2BZ6V4cWLZZblES24pwJ moBfm0oMe7JklRqj96735sVB/hxLmKV3mHcU9L1481bcWGwRbjJ6ucWQLGWlYGr1SEXK OXhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=i5FjBlsLhuCRdCtPZLXAHFkqXzrq26LK50OQP6NjdEs=; b=tXeDLD7lrZenB9esR/9E+HVNb/Wukxi782rynouMJSBulCOJPeJ4BcnDzmokSaxQv+ 7XNFUdXLtZRD8vo+ZkCkZOWqg84I8cO53vOEUtagRcGMEn+lqgM8zILhvzZCCG6ViDEx d1I9Neq4nuOdX0RwC8P3QPt/8IJVUzGp6tj7G5zCz+SFxrcgs/TCgd/bdFybD/5csSuk UCSwyWykgYHusVWlFQLmC4d5Y0+wGBk4GCGWOaWExaXhJrST5RQ8Cj37NOybhaJapN1L Jr67TQ5+o2H9vV1Y9Z8O6B/Rf9YTVv1llQQeJidq9VQRFNCKT5OcZNC1iVwuG0/nyOVN zPPg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id w23si2182461eji.79.2020.09.03.10.24.08; Thu, 03 Sep 2020 10:24:08 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8645A1C0CE; Thu, 3 Sep 2020 19:24:01 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id E6F4DE07 for ; Thu, 3 Sep 2020 19:23:59 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id C03F81A039B; Thu, 3 Sep 2020 19:23:59 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id B190C1A023E; Thu, 3 Sep 2020 19:23:57 +0200 (CEST) Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.133.63]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id A3E4A402F0; Thu, 3 Sep 2020 19:23:54 +0200 (CEST) From: Hemant Agrawal To: dev@dpdk.org Cc: akhil.goyal@nxp.com, Nipun Gupta , Hemant Agrawal Date: Thu, 3 Sep 2020 22:47:45 +0530 Message-Id: <20200903171745.13985-2-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903171745.13985-1-hemant.agrawal@nxp.com> References: <20200903171745.13985-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 2/2] crypto/dpaa2_sec: support stats for secondary process X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) -- 2.17.1 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");