From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0068.outbound.protection.outlook.com [104.47.32.68]) by dpdk.org (Postfix) with ESMTP id 0F383FA3C for ; Mon, 5 Dec 2016 08:29:09 +0100 (CET) Received: from BN6PR03CA0023.namprd03.prod.outlook.com (10.168.230.161) by MWHPR03MB2479.namprd03.prod.outlook.com (10.169.200.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.761.9; Mon, 5 Dec 2016 07:29:08 +0000 Received: from BL2FFO11OLC016.protection.gbl (2a01:111:f400:7c09::109) by BN6PR03CA0023.outlook.office365.com (2603:10b6:404:23::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.761.9 via Frontend Transport; Mon, 5 Dec 2016 07:29:08 +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;nxp.com; dkim=none (message not signed) header.d=none; 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 BL2FFO11OLC016.mail.protection.outlook.com (10.173.160.82) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.734.4 via Frontend Transport; Mon, 5 Dec 2016 07:29:05 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:; UpperCasedChecksum:; SizeAsReceived:700; Count:10 Received: from netperf2.ap.freescale.net ([10.232.133.164]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id uB57SdmZ016006; Mon, 5 Dec 2016 00:29:02 -0700 From: Akhil Goyal To: CC: , , , , Akhil Goyal Date: Mon, 5 Dec 2016 18:25:39 +0530 Message-ID: <20161205125540.6419-8-akhil.goyal@nxp.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20161205125540.6419-1-akhil.goyal@nxp.com> References: <20161205125540.6419-1-akhil.goyal@nxp.com> X-IncomingHeaderCount: 10 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131253965482646910; (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)(7916002)(2980300002)(1110001)(1109001)(336004)(339900001)(189002)(199003)(2950100002)(92566002)(6916009)(110136003)(6666003)(356003)(8666005)(36756003)(104016004)(5660300001)(77096006)(626004)(97736004)(85426001)(50226002)(7846002)(305945005)(33646002)(5003940100001)(50466002)(50986999)(48376002)(4326007)(81156014)(2906002)(81166006)(189998001)(1076002)(8936002)(86362001)(47776003)(2351001)(38730400001)(106466001)(68736007)(105606002)(76176999)(8676002)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2479; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC016; 1:wMyYbD63wq/V5jRcdZomZMH9nKHjP8iDYqVqWnqTovz51nKttXXmvvnSg3Xenqxq6dzD3KiGbjnax+pXhLQ3xY2om4aJkz5bch/svL1Gxqa8EUG17g8X7NpqPoFZ3KeXmo6j7j6JiftrdsJmjBE8DidaM5mqRoEB+s5CzUI/yIn7geScNpYQ/dAKln4YR2eDB7DkdUipyV/rSWo5WlekhkPYA1key8W4NL1fMQ9+oP2rtwz0IRKtK296e/JOpEE6VQFKtmo3Tgk4UXBqhMCP1ERcv2H19/C5hqhHoEo7w5Mu2OM/71HQVUqimhfbe+xjKo8OE9paBmqRQdhO5aVLzK44E/JwIiVTvEOF3VXNvmPpy7BDyTBJpFpeNxEMXlD6NZ8g4fuvnMkhHu0QqHg99zYQLo8FYq1AGW0rSrxQcdvDZ/0e8/hQApqWWU6DptJhPRHpFyY+AuPe6o5MiT55uSKNCXje+D8b3uqhwxLADkhFnEVSwLfhuSUJ/7tcoNSfMgxyf6dEB2F8+XzJhJ2RBBU28s7ijtBnRWokCl9a248UfGD4tM9C9EIre08JhxGdNXQhBhTs4435LS1AUTDQI0W5SiXffDhaumoRco/kaVb2/w9skR4buNcupPzlqStbVxg6m91PUHXdoQSzECzVBSp8XGJcuiBIBOyvuZC8zD/OUxp4SkrPXTVPAz+JE5u2RAKwSgGqkmGcsruRz0PCwDuFsb+0HKLax9zTJulj817LmUOCV7s2zG8ys++xgdVH9oU0wXviM2tcdg5q3RZfMA== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 1352fd43-68ad-4a4d-5d7e-08d41ce0666b X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:MWHPR03MB2479; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2479; 3:kEX03GEkg90mrFBOm3ZCQhF3wgoG8HNzLLIptZAqE3DjeZRIhoqE3i0Pho8e0bTBvGE7VlQvcQT8tbRHqe6bKZpLCNy4HAakalZOizyhRFYg+/Q3nsY1As7lxLitx0kEIA+Lxq3yUll6P+4eKW72HGXKuh2WIvpuWPNcoDVEkvCmW3lPicLZl/ptgz8w2sE2dWlL8IV2R8sxMf3lKW+KQVIay8Nlkd6suDyDtNoCtxR4teQ9W4DhIo8xaKRWVg7y1+hnseN34r2HpuxrqX4naB7rajRomCWJR1CLN37ONMKSr7eNrkixm58AHoI7G8fUOOcKvm550tbgK4us293o7Vo/wWxwuhdKsSaVdH7WdXMMC4+uXswoBEHPp1FhRDPa; 25:K0jEJtaf8nfsJm2JHC/AvBD5mohOkJ8v4+IPeUQLUytLsZvZg6AAR6PpRCJfkKjV1ZH4WEOJH3zkrBtiB3BzcMFXZgEoMcGTsqUhoARNb7qPqpO4iUMRsKlYaxRtmCdfMXR2IPP4t5FJK576Hdq09qxl7t0aRAFg1ya91aKBUbrkESQQC58hz5rXqzKVUP7cztkTLJ5bDJ2yPd7W+Oo7ejpKz2F3e0PHkmBUQRIAhlvyQQU2k1+nWXL0vVKxt60FhzCsm0qX6sZheZmxZiG+sSTg5cUIMJ3jae+rcPX+oov+GjXHkg4WRURWUJPZd0FXFh9vTgRXluNS+/Let1jitjlXYo0j+QSRDtckOldtFfayG+Km3FUabmms7iOep3XaJhWU0h90P348UozRAIbEniam9+7XheAYJaQPPOy42rnlEMRLnHegv6dNXGmnOoSVwYzePaJgDLcMdt/M0G1d0Q== X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2479; 31:maurqMT/HNrrmJJCPvM+hxJEWvRgcanJ/dpTNGpEW/qZ0D1naNUdw79qEpoGDZ+n+Yd36E4k2QQ0x4b0TG4lq3mkc9Zx9+BDL8A7jeTY1LramF3fOkb80MZCUryUi7OD0PfFlxw/OtJ9nom67bTapI0waJCE8FetvgU8tViodJEXRWzrDDa9zWbzpmnqi242hAcnY4m9/cH794L2UdXrZIjrgBup8UwIDmPeqPO7fYkSc0eqtuFo7HhJexOWYQwRPXVeAcfPBII1vheKiNzKA2wzh/fr9+/j7Zoblc2AnBo= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(13024025)(13023025)(13018025)(13017025)(13015025)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6096035)(20161123565025)(20161123563025)(20161123556025)(20161123561025)(20161123559025); SRVR:MWHPR03MB2479; BCL:0; PCL:0; RULEID:(400006); SRVR:MWHPR03MB2479; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2479; 4:85B/cGAL2jjwJYMDjeU8prNkhzOx/wElXfOjsW9W9nmd/uT8yk+WpHVc7sEniIOLpR3tOYHth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Bx6pgb7dWG9txcxVK1oNKSsfK+U+yLdpPWgcxJRsnx1UFUAm4uqyAa9h5H0llklfOAJt92R3Ty9QyJ4FK4kl7XlWyPO9sD0gYCSTe2AMLMXi5IuEh46fdZ5Jw6YXk2wwn4uNJJ2IYwkPlOsUXhDG0miNoR2G5sWFqZSUoehIiqewOs6FmW31IaxpoJF046+68NlM2Rom5mHtja8JNjnSQOzg1uTxXmm5Fz5LKRvxmbohFEJHQ1HISI4b/Y64H5ftRVm9EQbp42QYmLfXXfgkUwINhbCG4m1TgWcQ== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Dec 2016 07:29:05.9871 (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: MWHPR03MB2479 Subject: [dpdk-dev] [PATCH 7/8] 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: Mon, 05 Dec 2016 07:29:10 -0000 Signed-off-by: Akhil Goyal Reviewed-by: Hemant Agrawal --- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 75 +++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index f249e48..7ec06da 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -1347,12 +1347,87 @@ dpaa2_sec_dev_infos_get(struct rte_cryptodev *dev, struct rte_cryptodev_info *in } } +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; + } + return; +} + 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, -- 2.9.3