From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0048.outbound.protection.outlook.com [104.47.36.48]) by dpdk.org (Postfix) with ESMTP id 36D9556A1 for ; Thu, 20 Apr 2017 07:45:04 +0200 (CEST) Received: from BY2PR03CA064.namprd03.prod.outlook.com (10.141.249.37) by SN2PR03MB2397.namprd03.prod.outlook.com (10.166.210.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1047.13; Thu, 20 Apr 2017 05:45:03 +0000 Received: from BY2FFO11FD030.protection.gbl (2a01:111:f400:7c0c::133) by BY2PR03CA064.outlook.office365.com (2a01:111:e400:2c5d::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1034.10 via Frontend Transport; Thu, 20 Apr 2017 05:45:03 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BY2FFO11FD030.mail.protection.outlook.com (10.1.14.211) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1019.14 via Frontend Transport; Thu, 20 Apr 2017 05:45:02 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id v3K5iavf015982; Wed, 19 Apr 2017 22:45:00 -0700 From: To: CC: , , , Date: Thu, 20 Apr 2017 11:14:23 +0530 Message-ID: <1492667067-21968-10-git-send-email-akhil.goyal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1492667067-21968-1-git-send-email-akhil.goyal@nxp.com> References: <1492616268-6307-1-git-send-email-akhil.goyal@nxp.com> <1492667067-21968-1-git-send-email-akhil.goyal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131371407029291474; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.158.2; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39450400003)(39400400002)(39380400002)(39840400002)(39850400002)(39410400002)(39860400002)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(9170700003)(6666003)(104016004)(305945005)(36756003)(2950100002)(47776003)(81166006)(38730400002)(50226002)(110136004)(8936002)(8676002)(189998001)(5003940100001)(53936002)(85426001)(86362001)(69596002)(50986999)(33646002)(5660300001)(77096006)(76176999)(54906002)(50466002)(86152003)(48376002)(356003)(4326008)(2906002)(6916009)(2876002)(2351001)(106466001)(8656002)(105606002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR03MB2397; H:az84smr01.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; MX:1; A:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD030; 1:g7j24PM7HvMsTulAgok0NtQVJK1ECw2NZXDQsOBcuRnklHBRIn7eg/eNQeH/1FQa1ZxMgumEMPqIi4YhTg9yy8nt2zW0LOBpjtHdOlew2QPHwnKfHnLcYF8y1oLywFP9yAJwqMzwpRgSf6J/JF3h4LQJi3BB42A1tiYIckIuuM64OpsJMiSYZ8aS3PXvQfvCHpAVL0NJiHIxaYv94wKnX5AVZ7nP2WptkX4JT5W5aNaFkRvZYD3uwd5i6teqj2uOjoo8cvu+CWNMCXXYH4+dCWe8ToZ8bzr1sosJRSG7UWfq5zt4wVDqwGEQSF2wTMiHrrycgZD9YdnMUZzs7GYsH1pWBbxUi91aCWvWjL2ScvHmyMwrr8hV/1fz8nde2xmPxUQlHqDB3jWN3cZCiz+lhUCyd99sprHCkC/VzeXVlIfEGytAW/63zog0dlmpZDup2Y+a0IDcGBie7W3FkSACFePsvWE3E9X2SPjnzUcL4wNOKI9fXzOWs8+ZxbZgQlLM+ZnncM30vKXYFlZRZLjaPD4F+tSNvrSulgy5Bznd4oFEQMmT0juqriWgEBn95vImZvaF8yZtIzWFFuez+FBoulUXX+gznC/0QQ07GIHll5oUe+XQfoL3XLYNe5FXqiqkFS5iy34JTXYQNyZuNTFf6YrO8gTry/kNBrWg5fSxDH546L37ARzq54z2S/STvySEgiDODKl0MUlHa+4g0B7adQvLON42CDkQDYBcrVhMssai9KHjjW3H7IFcBkbv+Uc+AYG82RK3b9Syk3s/20dKXg== MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9ad8a781-141c-491e-5d69-08d487b06401 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131430075)(201703131517081); SRVR:SN2PR03MB2397; X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2397; 3:Ovnz57/6lvpSCwXsMFMqc/2sRtaKcc7qwlzWjbIwphTGyiFZD8ACC2Dm+0eZ0zjeb3kCCtE6P2d8S6Gi6ZdCmXbcAswMT761St5dawwz1sA1IJv4WyhWDKIeq550TU5flLSGTqvyWnPBagDj+U8Pok/gV60y/YrM5HwE2uS5lMjCW05JV10NRtQuabpjW4ZZYCmBfgVWkgM09sp058gDvwsC7YhYD7DoHlgtTAFGisJnlFUb5gSEW5BcHzqCeHULr5RVGvULy4NYA29Pq4mjoUPpH2fP8z5yfEhmRCzhrpk6U4Vn3UX+Gyr0YD/6yOqVgI7ykouuvPRT8HMqUiMndKwo2Z4V+61dJJlX5njeHtsi+xmgcKNcCl5NT7fzPj4xgKC3JD9y/tZcKiydqzyIkDAsCYSqPyoBXYFKAUscLghUH8yO1JsVaz5EV29ouzC3; 25:jqqq1XMePjaek9iq6h4S6Yu6Omwx3omkoLTUvevf9hxA8BgDI62UBHMlrcW62aMmiOE8/tsAOfO0v3ZBRjRELyoM7ankmYsw7kc6YOl6tPfbTZqEeAJmjC4E7yhRIwzj4LnzyEJAIkS1d6iYLo3oWh+V9OH6m4q2P0vP3+f57kOXCgQCUvhiRDD68LA8oPLejFfF2MWtQUi+4la91YuovPTdkEHzuTF9jNeOO754ygd6+m9dNvvPwKUC/Yps5ovTZX0EBvVB7kLx8Joo84c6jUDExrIwhT3s7XqrllZIvMp+Ot4mmU0vntQlTWAemBGNHck3SC3iW3KM9pbkxuJW81OTSjviIneEVdsNkwOEB/UlAF7IhQw2NBQJ5ANYrnIpKbkGEnJzo62yKlb4/uhzUkfdxIlfl/Jf/S8DZx2v+DYcUuf+kXdksrIxbSkqVTFpF2VJhZDue7YtKk0Z1BmIBw== X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2397; 31:ojZSepGngSkSxFsFfmRr60WHLA/RXoTPUzI+fBGnj5cvSIHCBYxwYcgIu2G2tezm4VHtSCx/dp8+E3kHweMnnKH2Z/G3p23BqeiTFBMXRn+ie0pjgg0pJOXBNio9BlRuV7SZPnleKXl44qgzg++/YZJ5mOO7e43MRDCM7MvpnNOqld8GPDPYRNnzpsEyoIAViSPt7Sm1SI7aUchHaRXQOY2PD18t8zSZNw2G4r8BDeP0E7HBLPoNyYF2uvrhz7au X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(601004)(2401047)(13015025)(5005006)(8121501046)(13017025)(13018025)(13024025)(13023025)(93006095)(93001095)(10201501046)(3002001)(6055026)(6096035)(20161123565025)(20161123561025)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(20161123563025)(20161123556025); SRVR:SN2PR03MB2397; BCL:0; PCL:0; RULEID:(400006); SRVR:SN2PR03MB2397; X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2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3MZbWRWr/OdoI1a3yl4N+dhC8ZmZIjEc4SIpnqKPsr9ENbnYLG5wmGGOnGdQKG9XmxwzKMdBLpuDbMUkaGJmuzgSyL+qYzT; 24:FXRvom9/2M593gswDvUOnYYku0imVDL4mconhiKPGh+PHJ/hugWjn6qF3vDxnK/Q/oEFg19KDKRcpvT5G/sTnuDY+3dJ/cKqvzulZfMiQp4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2397; 7:y+AHz2d7S2fdf2cdCAiBPoh5J8V7Hh5lVaBQVPjFsloOSZkEsIaBPaPCut7b3zq5OPXeTZldLeQZFuySUqd2KvtXsj1N1oZJ99ChU2gTplnbTH3CoaaF8FFV1/MdUx8jc8kCaEeKRN0L2Dh9yUpEjLuVMxQV4Zqv0O6NtrpZIHMrr6NLuQakDtdr3XmdGR9oGIMYlg0ZQx5kfKWVo9gvdp/pef3/3I+d37YG4wACBHM0o/jCJ8Mc8DaodyeW8NxRIUAElpewv6v79iPRmKagtUPdEJ/XU3gu5EjRbncGbf+RGMYao/6fExIeFOVY1uAe1ZDrrthnSaeNi7UAmBGNvA== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Apr 2017 05:45:02.6795 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR03MB2397 Subject: [dpdk-dev] [PATCH v9 09/13] crypto/dpaa2_sec: statistics support 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: , X-List-Received-Date: Thu, 20 Apr 2017 05:45:06 -0000 From: Akhil Goyal Signed-off-by: Akhil Goyal --- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 76 +++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index 680cace..4e01fe8 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -1387,12 +1387,88 @@ } } +static +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 dpseci_sec_counters counters = {0}; + struct dpaa2_sec_qp **qp = (struct dpaa2_sec_qp **) + dev->data->queue_pairs; + int ret, i; + + PMD_INIT_FUNC_TRACE(); + if (stats == NULL) { + PMD_DRV_LOG(ERR, "invalid stats ptr NULL"); + return; + } + for (i = 0; i < dev->data->nb_queue_pairs; i++) { + if (qp[i] == NULL) { + PMD_DRV_LOG(DEBUG, "Uninitialised queue pair"); + continue; + } + + stats->enqueued_count += qp[i]->tx_vq.tx_pkts; + stats->dequeued_count += qp[i]->rx_vq.rx_pkts; + stats->enqueue_err_count += qp[i]->tx_vq.err_pkts; + stats->dequeue_err_count += qp[i]->rx_vq.err_pkts; + } + + ret = dpseci_get_sec_counters(dpseci, CMD_PRI_LOW, priv->token, + &counters); + if (ret) { + PMD_DRV_LOG(ERR, "dpseci_get_sec_counters failed\n"); + } else { + PMD_DRV_LOG(INFO, "dpseci hw stats:" + "\n\tNumber of Requests Dequeued = %lu" + "\n\tNumber of Outbound Encrypt Requests = %lu" + "\n\tNumber of Inbound Decrypt Requests = %lu" + "\n\tNumber of Outbound Bytes Encrypted = %lu" + "\n\tNumber of Outbound Bytes Protected = %lu" + "\n\tNumber of Inbound Bytes Decrypted = %lu" + "\n\tNumber of Inbound Bytes Validated = %lu", + counters.dequeued_requests, + counters.ob_enc_requests, + counters.ib_dec_requests, + counters.ob_enc_bytes, + counters.ob_prot_bytes, + counters.ib_dec_bytes, + counters.ib_valid_bytes); + } +} + +static +void dpaa2_sec_stats_reset(struct rte_cryptodev *dev) +{ + int i; + struct dpaa2_sec_qp **qp = (struct dpaa2_sec_qp **) + (dev->data->queue_pairs); + + PMD_INIT_FUNC_TRACE(); + + for (i = 0; i < dev->data->nb_queue_pairs; i++) { + if (qp[i] == NULL) { + PMD_DRV_LOG(DEBUG, "Uninitialised queue pair"); + continue; + } + qp[i]->tx_vq.rx_pkts = 0; + qp[i]->tx_vq.tx_pkts = 0; + qp[i]->tx_vq.err_pkts = 0; + qp[i]->rx_vq.rx_pkts = 0; + qp[i]->rx_vq.tx_pkts = 0; + qp[i]->rx_vq.err_pkts = 0; + } +} + static struct rte_cryptodev_ops crypto_ops = { .dev_configure = dpaa2_sec_dev_configure, .dev_start = dpaa2_sec_dev_start, .dev_stop = dpaa2_sec_dev_stop, .dev_close = dpaa2_sec_dev_close, .dev_infos_get = dpaa2_sec_dev_infos_get, + .stats_get = dpaa2_sec_stats_get, + .stats_reset = dpaa2_sec_stats_reset, .queue_pair_setup = dpaa2_sec_queue_pair_setup, .queue_pair_release = dpaa2_sec_queue_pair_release, .queue_pair_start = dpaa2_sec_queue_pair_start, -- 1.9.1