From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0070.outbound.protection.outlook.com [104.47.42.70]) by dpdk.org (Postfix) with ESMTP id A0E5B10D8D for ; Thu, 22 Dec 2016 15:51:59 +0100 (CET) Received: from BN6PR03CA0031.namprd03.prod.outlook.com (10.175.124.17) by DM2PR0301MB0752.namprd03.prod.outlook.com (10.160.97.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.803.11; Thu, 22 Dec 2016 14:51:58 +0000 Received: from BN1BFFO11OLC001.protection.gbl (2a01:111:f400:7c10::1:132) by BN6PR03CA0031.outlook.office365.com (2603:10b6:404:10c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.803.11 via Frontend Transport; Thu, 22 Dec 2016 14:51:57 +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;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.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 BN1BFFO11OLC001.mail.protection.outlook.com (10.58.145.12) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.789.10 via Frontend Transport; Thu, 22 Dec 2016 14:51:57 +0000 Received: from netperf2.ap.freescale.net ([10.232.133.164]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id uBMEp6TL013482; Thu, 22 Dec 2016 07:51:53 -0700 From: Akhil Goyal To: CC: , , , , , , Akhil Goyal Date: Fri, 23 Dec 2016 01:46:58 +0530 Message-ID: <20161222201700.20020-10-akhil.goyal@nxp.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20161222201700.20020-1-akhil.goyal@nxp.com> References: <20161205125540.6419-1-akhil.goyal@nxp.com> <20161222201700.20020-1-akhil.goyal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131268919175617722; (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)(7916002)(39840400002)(39410400002)(39860400002)(39380400002)(39850400002)(39450400003)(39400400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(5660300001)(97736004)(36756003)(626004)(8656002)(6916009)(110136003)(38730400001)(77096006)(47776003)(86362001)(305945005)(356003)(105606002)(2906002)(1076002)(4326007)(85426001)(2351001)(106466001)(69596002)(92566002)(8936002)(189998001)(48376002)(50226002)(81156014)(50986999)(8676002)(76176999)(2950100002)(68736007)(81166006)(50466002)(5003940100001)(104016004)(33646002)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR0301MB0752; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11OLC001; 1:bEbLqeByaavkfmx4gMicGpDyuNGrQRhPaj30WRrf4H3/8dRIxeEJxhoKFszH6Da1IrkRRsq1UkQhhQZCD9KNZJKiz813LRvI/fNamNUjed2QezDfDMp/aOPJmD9C0w5kKcWLmRukSjdCOTksosu0UFxq/vw5bcGaIVP/aKAbY/mVfPb5g+WitpRS+P255ExYpjROs0VaG5ktyGe2jB3c9uJtLNIEhiX+Fro3ZkVp7ImzI3N+6gNYmR45YJ96QaCUeGO0L++JNiD1ckbmqKOScp752WTrusBopoarj7CxouDTEB7zD/VweXVQZzzmICNa/VBff1JUUJjvlkRT2ZC4Jmt9dJeKORXFk7shw8nNcGbKG23uQacGBIxuhk4nuCAAUD+FnVH7z1qIcP1Cw6ryiFu6aTTQMAxVzCc9ua0RIG39q1wVYJuXCGyzibP/+wQZpH/GQJFd0ipgHSQeq3uTJEWy0cOfmGI/MGJQLeRyxT8FRFfoagstvSDvTmS1wHJKk+F2VykZSV5AC5QoqaM0mGFQkUKyz+1/Lvf8rGisVIWLBw5kAcfzB1NuT6EjMrSqRYWAKC4QkeqIVEMQTCvj+fGrlq09Nk9g2aoo4vYbIposOb31S7WfLRplkhJ7atxYaNsybx28UgwOn0eQCOSYoErqWUGeB32BWQP3WLHeKuSA9XtRri/jq45j2cFzcjzBvTx71L5BgzvrFRRLRmAWfikNNdB8GFgHvoaeCt2s1qbxNTkWtD7zNKUBhcxh1seseWX2QIOCmmvvlwHZ+76PkA== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 52c27478-00c9-4ff3-bb5b-08d42a7a13f7 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:DM2PR0301MB0752; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0752; 3:4TxbPJx+sx/8vqGlTb2BPpOgsQSLuhJNzNl7LmLW2/a31a6NgAlW0tXJxjnpL8C+dOo6uIPi90/3K8+tzbkeLDXg/I8OaXbGhIfseNo+eeHIL4/UmvNC0Pgx/eoBITptYfwtRpl54MQuIuPCplx6QFo/HNXXrGfITMpZIWSmypMMi8JoqQbnMV98L5kT4YsLkruSQwoyXVS6TqAr/AuyFetvnh4DdEFxnVtjaevLTL2oPBrHzkWVQbJxAfVZ0AZUp/urfShrPdq5dyW8fGfo63IO0+bDj6HIIqYylQh2TLZn4IGmXUUA5nlMWRLCHJbd/+9RVDleNlaX0UukhOXGvPUIlJqg46+Kdri8NCNxBno=; 25:00dRg7Wl/93Y/FXzaHsBn16Dli4NElDrR/40bElhyFNjHvbrnng4ONDZrhKFR/pnaG7OUV8dSX0Jw+N2kpDwCQSg0kkV/iQX2I/nBZ1vg5hY3DPv8nIk0PoYJvVakpT9mV0fFtVB+FKBrB55q7RlDt5U7rr5ZuP3HGGrQAPIDqiUS1AzcoRoAFwZ705OFSCIyVUYqCSTC/PnmIGRiQPC4iaJf692STP/peDlIq4p1hERFh9IvKNrem+LNo1d5FrMGUk8f5wLTbjbeeMru05WlAYU82nbo01WkxFm+bKhkP43Cfiwm2/NEzPjFAaek01rzQgpFfOUW8q5sjY8xaREYNgpxe1u+eFvbVpo0zR6xyqrrQVpu6X49xFNdTqEXeZncg+MWRnDZm/AbF1sZFwndTRQQ1hzxowC0/h8KkGeM9C3crTUXnuJHromAs3zWK4kXwNTGmNO9KWsrtNj3bXYag== X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0752; 31:qlf2vqglC+pmFsSXTXQrMQ+IejJ7WmFtVs0OAlCnQGHTjnucq3Sxzk2wcwuFxc33R0MvZ/8AuXgkYL2dVDIP4YPphDFlmBayZcj166EX/z40xKRQWH6krktHZcZI5BlIRYglAtM2dC0rXqTvdNBo8PtefTq6DVJi5P03SC93aIKToz4sQ7kY8VsXQWZmSCQxi46obgWRFx8K3xyrlA+rcVbjLPMbu4BxImOCDPa7uI9ezX1VKMUAYBYUfgwu7X+aX/pTdDFFBy37sy8lzSvm9ZJzw+IuoNkHl2f+TxwQdrP2fXgkPr77lsCYqpB3I7pt 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)(13017025)(13024025)(13023025)(13015025)(13018025)(5005006)(8121501046)(10201501046)(3002001)(6055026)(6096035)(20161123561025)(20161123559025)(20161123556025)(20161123563025)(20161123565025); SRVR:DM2PR0301MB0752; BCL:0; PCL:0; RULEID:(400006); SRVR:DM2PR0301MB0752; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0752; 4:VaK8Br9IcByeni8YR4EWKNZuoCY9ReNWtxlglkYntxcGsVX4kF1SaBirr51j5/nampeyXaq/g1eE/3JVNegVF5ht+SKgEsWpOVMSpfoxf2z4EKJqTRwzDTF1nCdgc2R/3tJuPfcg5cSvJLAxdVaTGYcoMULHkjToqNdFxgpQfKP9n1S54nKpycyJldQ6yirD20Giqi6wixoCKeMbEJifUsUjWCI420RLvHaZ8K4DW5ucPL1+LGU4mvO4V4mAQSR+g5pEIcTA2ajd52+Sqpu5qmWCbvSr+wjuz58rM3ltLiTXaxexrqd9KEaC5J9VT1ObdaUcv9N2ixrIrTKODM5fXBPM9uFn2tx9Jl1b1/e4+SSeOW+hrIAsK1+C6qRF+cKZ4aksj3f63EU/NJslq0w9VUrAv/HKUQAakeTu0G/z+3bJQWboDS7F2eqn7Hsd55iMxu2o6vidX++t8t3DNQk94bVg3gEhmBM5fvIQ450wr/RHpKIk/bx+3gm+U2mAE9NQv+XJcyir76wricJWAaCitM4MRLzpqtfD/Pq5H7jp5fEIxvzRDRCEaazkFYuyTKE245rkXo/rvA7Soy6FpMvfkUl3VFF5R0iJjyVz7+liNn3yuipefUr8ekVZVu444KJTFEgGY2lsvxgWZbFOgklv4dDWVeNZ/LGzkE03Bq4rg80JMlPTge54uiXhEZzBDwmjA6S86jrfHgADQHmQt1ThysqAk01iCVaLgaELaeRd8cnIK5itAYzuGCuiIi077+aZ X-Forefront-PRVS: 01644DCF4A X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0301MB0752; 23:pmwqCNHL/27AsulU7bU6b12htmPmnlw9wjf8RPq?= =?us-ascii?Q?ZBFqVz8yW1EC+FYsXBodNkuodn+rSege4pb5oz9tro1CNvtodanrCYrI7D1s?= =?us-ascii?Q?R8kOlp5fWyPCyhAsoUUqAUXqirnkLEugCFu7X9H3Rp+7gpwhBiUzPZWq7xNK?= =?us-ascii?Q?dpaoNP5XZD5aCdA3ByPggMm3/z4sPU+x2e3r8EW1L244E7T4gm37bZAEARpo?= =?us-ascii?Q?OMIkYAEaMjJdUT1jBkhN3Tw4NmcJhF7PriTIwXHvQXY4WvbufPjqAdw2Ij6q?= =?us-ascii?Q?mxgED0O7t7srrpEREnVqkSMtFOJHEOfcTuFddZim3/dt/id6vawQfhswlt/W?= =?us-ascii?Q?QvBWic5UA03ONlROB/Dzf67TN0wapTQnsDiBjWi5vZnZugvm7iFONDrAtjQa?= =?us-ascii?Q?2EZp+3gMYoeOD97tkaS0iOB2iGntI0294vs6VIC4itBHLfeLLQLwgWmZfgKM?= =?us-ascii?Q?HP2id0WJwgs23/6LpjNh6q7pk6heW7LKdVlzGoHU5yOTwOMqW8CqXHsvZo35?= =?us-ascii?Q?EA00sFRg5oYVx+gSwQtRP8p6zl8Z7mdOCSPSouzRaeX/eRB6fHu2Em/cPHF9?= =?us-ascii?Q?/bSThf/Q641iVzZV45IfM6BqIDu4SpQsrUEo9ofkY1YJ091sl8cdS9k3wllS?= =?us-ascii?Q?91aQTnsyVRWI2laLCf8yLFVUtomOAVem0dLt9fuH1u66G/91c4zV4R6ThrSK?= =?us-ascii?Q?Us1r+ZuEzrtMjH3Q+22NY0uSGGD6p5MzwFica/nvVgsJrDreRDukFGEfpAjI?= =?us-ascii?Q?znwn1MwalabiqXg4UUrdgQMa66yL5xo8ckBWIEbgIOVqMNRp5F06qz3ruei7?= =?us-ascii?Q?kVEEVcuPyMdIER18V9arLmS+m3OcaYE/80mr9TpX4xtxEr4aDct1V+PDblB8?= =?us-ascii?Q?JrI8vjx0nes2GUqd8qltmLXelzmDxRH5vU1YtIAx53NeLKn0C7/TlJox23y0?= =?us-ascii?Q?4fx7GmhwQ1H6vMESCitr941TKqEB8GlcseBeEznP5KKdXaL1lOWXET5rop3l?= =?us-ascii?Q?jZ4VfbOzRRWEJigAa1jttjtNDc1crmaVFHJgyMBtDIydBdKCV7/2ucaODSoL?= =?us-ascii?Q?GGLkTj0ascpp9EQNa0lhJGxCXpeu/Bbv+SkyAQZNMl9x9mybr7jc2cLWVHeE?= =?us-ascii?Q?OpaqRPpGC/AlHGJBRvCYxTdJ4LRQO+yKtpQbtQzwr9YpL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diagnostics: 1; DM2PR0301MB0752; 7:WahKtzeM/ue50zWpYicwLxYEznxzY4xSUgu9rYqhuv5ibWaK/rClIRbp7G+7Qx6TCjTZEFZJgwzV1eVrCXXUqWlJdy9nZ8CIoRU5TXyejMW10NRz5zFpHp5fLr2DOX+oDz/oIGEiZbBxs4GqvpoBpCJ9+sLfTkcGNiFiHNSZ1ixcdvavtO/BGyrqYCljTzhH+uFDPKsCqumxvJ2FEsDZy5FiHUmAUlLs63NuU0vmFGoPceYzW10nwOJHuWoUP8ElL13INprnBF83RWoxUc0TN2VTOyGBIiOKhQloVxzpRh+67lNoN1fIwssXqv99/XXkPJHYTJB7xtgIIKpgbbDGHgbPUd4lYJFarUATFZHwb9bNV7xfqj3tJu3RGNq5iFSz2XJiBJqFlGQBiACrEy94s4L92h3uK54+uxulk49N07+L+Qt0XYyUhLzCena51w0pieNpkTDZtCdHv7j1G0CsLw== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Dec 2016 14:51:57.2809 (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: DM2PR0301MB0752 Subject: [dpdk-dev] [PATCH v2 09/11] 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, 22 Dec 2016 14:52:00 -0000 Signed-off-by: Akhil Goyal Reviewed-by: Hemant Agrawal --- 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 6c9895f..f4a43d1 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -1384,12 +1384,88 @@ dpaa2_sec_dev_infos_get(struct rte_cryptodev *dev, } } +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, -- 2.9.3