From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0089.outbound.protection.outlook.com [104.47.38.89]) by dpdk.org (Postfix) with ESMTP id 5535E5A8D for ; Wed, 19 Apr 2017 17:38:28 +0200 (CEST) Received: from BN6PR03CA0050.namprd03.prod.outlook.com (10.173.137.12) by SN2PR03MB2287.namprd03.prod.outlook.com (10.166.210.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1034.10; Wed, 19 Apr 2017 15:38:26 +0000 Received: from BY2FFO11FD035.protection.gbl (2a01:111:f400:7c0c::146) by BN6PR03CA0050.outlook.office365.com (2603:10b6:404:4c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1047.13 via Frontend Transport; Wed, 19 Apr 2017 15:38:26 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) 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.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD035.mail.protection.outlook.com (10.1.14.220) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1019.14 via Frontend Transport; Wed, 19 Apr 2017 15:38:26 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v3JFbvDZ023764; Wed, 19 Apr 2017 08:38:24 -0700 From: To: CC: , , Date: Wed, 19 Apr 2017 21:07:47 +0530 Message-ID: <1492616268-6307-13-git-send-email-akhil.goyal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1492616268-6307-1-git-send-email-akhil.goyal@nxp.com> References: <20170410123108.26305-1-akhil.goyal@nxp.com> <1492616268-6307-1-git-send-email-akhil.goyal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131370899065944013; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39860400002)(39400400002)(39840400002)(39850400002)(39410400002)(39380400002)(39450400003)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(9170700003)(2906002)(2876002)(4326008)(6916009)(81166006)(6666003)(2950100002)(85426001)(104016004)(86362001)(8676002)(356003)(8936002)(50226002)(5003940100001)(38730400002)(110136004)(47776003)(189998001)(54906002)(36756003)(53936002)(86152003)(48376002)(105606002)(106466001)(50466002)(8656002)(305945005)(50986999)(2351001)(76176999)(5660300001)(77096006)(33646002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR03MB2287; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; MX:1; A:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD035; 1:z/I+ttjKn6wfuLj7dUb1+CzPAeD/uhEGbcf5xgJbF+Q0lfm3hqQ4kH+RgGyhc1FANI/PRgwN1mquNJ2WMViImpiSjRLdeXGqCxnYHOc2iUw5oWqSzDO6KTiGbE3tmGcED+onWSGaIsRUC1pDZ5SCvyG9FXnRo9S2+rboJzE/n9b3+W7palgF4KbKtF4ldttoSKtm9ryOTPOWkEawCIdG6AVaJnzsr//s+J0V62da7FhY8rmOMv5YlzSVpkwg9A7CGJhaPJww61sIlG+xlf6ff0Zbn5EjGYsvTL6mIc/N7XVxzyAhsAQVT87ch4QoNzikmHDIbVcZ/qeKkM+jJVXctKaiE+hZ0/4WMFCXDciBeai483tq8Ljm+MwCpD+U4Vtkq3QSawjsl6J4bI3iAOIG5Z2acXFy+CblGknhYVawzpZw9NRYNWVmn/OnZD5O9Qzo+lkwNCQWo5cz89QmKw3e0DoMDh2fCnurSBBo4MqRMIZUEHnNntPTW3ZRYoH/rvKEADvBePE+jofWGPdKK+pDjchE1+ktaiUl8hLOFlwa3rxULmpAIE37eh+J7StdnZvYo3V+B9naTAdcmkCWfObt1pYwHMQAxh+3dYikDCbjrWxml+rSOT9L3gLcxUCbu0x64eetZszX0UwHrjuAMeKz9CAj413lS4ui6nVSWjXBtEuxe0zkcSvO/BSzZiqv43DL3v9GNWFOqVJyBB/La2OwAh2+Mt9hj2vq9aRc6WTT9isN6FVetse9ymR0xfbbDxp1ISHiekewQ04RDndPMdIH1Q== MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 812a73f5-00ef-4d63-37cd-08d4873a1f1d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131430075)(201703131517081); SRVR:SN2PR03MB2287; X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2287; 3:LmyX5tdLiaC4Z90lRobUR7xNGQ1NXmYG96kn3oFPSWzKB7WAtF4aNPRAqwwkreiNwO4P8U6GeRXzB7EC7vfDjHCscghifYd1exGVfQMguCmWnEFFGj0iFrDsEkPe3SszOvw3sZ3wtG0qwVohen61rKe4dgV+rjQN7w+1dtJ/qvYgjwpt5vIKG2VVNuyErOOOMmUbrlO0Wq30vVoZgddpW4g2zGvNAuPQlNb8sMtmPBgwbZRlFk+2NUEsqjz8/waYYasXx9/d0sM54U3Q1u36Z8cKtBM62DDQRqduBp8lL2D2ZOU1XGiwGHjHDHbp6TnMa14zibpFq28Zc9jCS2fun7XkbHE9Hsk+L08LmOzJ36zvayKRl+IOFYT4sL61u2oaT54Sr/yfKknz/5gT3uYl6VP+/NS3sALsKXvbYDs3yBApoX6UaEL4KSeQxu0RK9x8; 25:Jv3yt48W3PXmP3mrpBE1hk6Bbhcq3DZagDYDqLgRNwzer2giBOeE0lEjOPTvBFsdjziuEjSc0LRrwprowBaUn2vQCzqcWpu+eqQmPyIU/Zf4PQPBWcOJ6Org91Qwgx3NGCFCsMKfA/8vp7fxgUP9IPg/irqnMHXl80tBEiNhIeQeqdNq1Q8a45OuJq+eIkXX0yayw/64KTtFmZHOhmblAgqoVZNTKym+7PYk6AIINVsGFx6noPhhdqDhItwOmsPH49W9ZKxliOKikvoFq5C1mS/q2S6SYLToqyrCQfmr0Hp9VapQessH7YM0CS+iBNa4DOF23xejp4jktoT03BVDMyCiES0Upc+ihh1P9r3sg7z98pYNf+zI+8CufB7ZBy2ekqOzoiSdCN4DcUmKDMor7ybPhMADo2dKa44e63P7fGO5ajNQRhClqMP9og2iuO50f1lrMliz0xjrtpGIw4JD1g== X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2287; 31:mn6mGzuK7KVaBXlFU4s6LoBCVV1N4BJrpk1isF4oFBBgrtKCXpRjPRFrWEBx6VuP8Qi/PPA+Z4CTgt/7AgePACaqsfMAA6o8kxAER1L3uaGb5Og2ejfSSOqf2B66rrfQTqkrQ3AXhJqhFML9JCnH9H1R8I1zPgcWiuRxd1ETxhMdxH1z8ZrcFdqaZIfcxA4CijmckQUKuZ2smW7chW+a0B/S+1wM4qIJTwqy332PDFmpw9/Zhhy7s8ztgnYMYFuSMqytNU1gT+uJjxySLxfqRg== 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)(13023025)(13018025)(13024025)(8121501046)(13017025)(13015025)(5005006)(93006095)(93001095)(3002001)(10201501046)(6055026)(6096035)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(20161123565025)(20161123556025)(20161123563025)(20161123561025); SRVR:SN2PR03MB2287; BCL:0; PCL:0; RULEID:(400006); SRVR:SN2PR03MB2287; X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2287; 4:ahMDQ9aBKu2wyAR/zTARNT2BQpIaNzAruHs02QZODABU5WHL4aunRPkQL2gKt50V4XwL5XmZnKshUK5zk0SktkqU06aKG314OaEjf6942xYtrhlr8wxGXXgX3XG8gMvdAld1kvgvbNovH4EFjhNSczYBBswZBAkpCPc9+eH/hhwlQuTjSzVJ3TggWxcSFO2bxv1juzHdERhH3rb9Ii3IqpgwmwvzftHxInTox4YL/d+n5/X9SIkX6Gr/Y9CJlmS6pOz2pjOCv8Ku/mFDdA+VRflreYkHaDV5X6PI1S3Rlc1auGUDfkhm8WRqrfO+oMVclnpffmsW+/E+xJa/dpkHqkXTw1CO3+X+nVWUmkN78IJlRaIzw7+ykRHqawJqydoAq6X4s/VDlaWTOZM74xNl8+hrY8rLW/O0zahL12LbY3XT2/rsUq90Gcs0YqEoR2AcS2qZdKD9brneafCW+x/9aXwSk5kU+4tUn5D1d748s8tkoMQtzDuPxzqJ3SE29zdp7RYr9A/nDHHO5JCvk7m9qUP07m5uKYiS5a6ocBG2iSwr5k08EEtpvo7ONC+PddnQAYCfKvKxmgUqtSaxdvcXFtxasOSD/cyY8VU5su+yQ62vsqugKaALQ6IbBWkV5lU6oJtT53Uq0MDfPRlG2hXS4n/hohP/EnYlgl6loXztmF0O9I3DHwcyP/cQPZqAlk/iluRVWZ7yvzL+WaiXe6yjp84jF1VPn9aEAXRH1TO5bxYaB9b3n323Z/ByQGcb1WKNsnzNDEL3z1xihMvybKOOZDB0HmJk+wy+20wMzyA35dLuXc44xOXJnIMdvtiRgOvj/Wolz1ictJ2SSi77Zl4hwv8NDzsuKLcZOQH+cIWJNXOf8sr78xeMTUtF4gnYw3b/ X-Forefront-PRVS: 028256169F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN2PR03MB2287; 23:GSEYrudHdB0WfKS1jlyE2kljXTw3tJiRkNaPEZX8f?= =?us-ascii?Q?Bed0BgfBfAi8tpUYWgy4lBaWJAFTujO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wEnljypLk9q/Vp8KcOtaY38MQyM+aenXaYpxviaz9hEi7wXX8; 24:8Gx/SyWlL8AVuuawqOWpMhgQco6bPZ682Vnb5TEUmPbT+zlEapS+4GeNvR06U2G8PF9VaSXoXnRwVaLhIV+eQrqLoRMRfCjirn16mUrHvjw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2287; 7:Ky/3IGcpQmcuebx886zEmkhkmuZ7m22zDh2Ks5E2/xIdXuweeSGOIxuIQrJ4MFBqsvlpF6YnQaZo8mXLrCsexIHi0CwxL86FWDk6yPe2miCBiw7yX43sKGZX1FiBbzGngRB/KXJyUFKA7XnNv+l8ItvcMMF0XNa0pT+/RCKryeV37zB6KdhqLxsn3LekrGOkOdmv80arBz2FBV7bgpOoSPvos2KiZSZ3iLXdfB9JYI0bI7Zo5QP81aA6dGlZhPZVJB6ncvHvOKlVc5lC7noyRZZudEUH8uIWjnJpDnEcFy31dlhSf3XYoPTQ+7xWuPxqOEPvWArNtDfef0tmCX5SaA== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2017 15:38:26.3916 (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.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR03MB2287 Subject: [dpdk-dev] [PATCH v8 12/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: Wed, 19 Apr 2017 15:38:29 -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 7c497c0..4c38a02 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -1414,12 +1414,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