From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0053.outbound.protection.outlook.com [104.47.32.53]) by dpdk.org (Postfix) with ESMTP id E42746787 for ; Fri, 3 Mar 2017 15:11:42 +0100 (CET) Received: from BLUPR0301CA0017.namprd03.prod.outlook.com (10.162.113.155) by CY4PR03MB2950.namprd03.prod.outlook.com (10.175.116.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.933.12; Fri, 3 Mar 2017 14:11:40 +0000 Received: from BY2FFO11FD022.protection.gbl (2a01:111:f400:7c0c::107) by BLUPR0301CA0017.outlook.office365.com (2a01:111:e400:5259::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.947.12 via Frontend Transport; Fri, 3 Mar 2017 14:11:39 +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 BY2FFO11FD022.mail.protection.outlook.com (10.1.15.211) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.947.7 via Frontend Transport; Fri, 3 Mar 2017 14:11:39 +0000 Received: from netperf2.ap.freescale.net ([10.232.133.164]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v23EB3lb010625; Fri, 3 Mar 2017 07:11:36 -0700 From: Akhil Goyal To: CC: , , , , , Akhil Goyal Date: Sat, 4 Mar 2017 01:06:40 +0530 Message-ID: <20170303193648.30665-11-akhil.goyal@nxp.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170303193648.30665-1-akhil.goyal@nxp.com> References: <20170120140509.4495-1-akhil.goyal@nxp.com> <20170303193648.30665-1-akhil.goyal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131330238995744193; (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)(7916002)(39450400003)(39850400002)(39860400002)(39380400002)(39840400002)(39400400002)(39410400002)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(9170700003)(104016004)(6666003)(48376002)(8656002)(50466002)(53936002)(76176999)(50986999)(77096006)(105606002)(92566002)(2906002)(1076002)(54906002)(4326008)(36756003)(33646002)(5003940100001)(106466001)(189998001)(38730400002)(110136004)(86362001)(2351001)(2950100002)(6916009)(85426001)(305945005)(50226002)(81166006)(8676002)(626004)(356003)(47776003)(8936002)(5660300001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB2950; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; MX:1; A:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD022; 1:uXg02nFc/L1Li5yE6m7t+LnlFgxUiLUg4YmcZ+obSRHTc6MzHS/aEwP8Qc7jxyvNU6OaFh+9gHbPwBKi3BA42WMjuFnVuHFRmk2nw0/aagSyARs3H3cuTbZsQ7il+/wcrGWPMtfOEw1jt1So5XwBORaafM6lnOBERC0ocWRoXVjUEutKA/VsjcBqEYDXdM49+apbkULlUJMDM+hrFT2AJQZyqcomDMx9nVT4jOAuQBqQI0XuwBm9ckWhc5/MkbfJ4WHWlPZNabf39iFXmhtKSCiY6E84DnZD1TRtULeEHkjSXws3KG2XVFChOakj6nuYW3Y9o9FKCVXn+4+8ulkCdSYXqec6ClkKR/6nzcGmPblNB5K6DPSPumjMUaPf4Mwb8y/xPPBzIxE5PFmkq/2OGQ9UTLdHin6wx0LBogs0EaOkw8ftKiiLRcIZk8ls3N/f2m+Wdx0mp5JDf54FibpZxe+Fy9f+09j2nOT5Htpa2Imz1iErK+22xSkwINTlwWcGFKNQawK8c/lzI+ox03p3sc6YjHZ0M/tyC+q372KMlLLKPSnxlHP3CTFDy5lFA3aQz9nP+2anfsw63364DelYG+SstQr4Z4upc4fiW9NsiS3g+H2+xuJ3Y3TLIW3GlNkd8xSvk+Mf+ttxwVnN7eallWrgHUz9uaPrs4d3QlTgfuzvCE3VWADc+ChqI/cK12T7iTzq23/2YjdyQUaKjnfsIqQRne+5E6O5kSPRYjLDh/73GRE/WOaZUnRe3CmXS42k MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 3fdd1240-3750-4ee8-6460-08d4623f3610 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY4PR03MB2950; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2950; 3:n4SBx2Tj+psDZSAtKwpH32BcA+e6Az2I78iQ4/7dqOp49W771DKH4SYQOdmbrEGayZTr7V5kCYpxvkm9T/LMhtKZkB4REYGt/pCpLBqUsyzeUgjFVs4zrWX0t7xwf09nSHHPICN5oBCGKTRMnxzuCufrtj+PFqTAloI3R/Vp6Q24nRCBuqiuVMrOifNq+Q18dgPEhmMgwUgkSDtlXLsBvUIGTR4eic7kVi53wBOwHg7/DZOkWCxoEueNbli/ZzQYm8ASAmg6IKAdisQ+bMDSemrQ4QBKjelLTo8noRV4nmXwXaHeIDmAWg2WF8eUjHI6D9FJTFwPwlMlkLIRHqQXk9xVq18FYBDHNKq7o7JZ4QpBCcpwuV/kLx1NYxp34MJj; 25:Z0jG7mCc9R2V8gFpS0Tt2BJp+Zy1SWGl5JMnkeJ+8YI6Rg0g931Y6CvLHCbvmcZS6n4ugTOd7VfBLscFBB0IW6PH1Aud9O7gvylERfuHdKVIBaYpBuXvRLm0zNxKMx5Y2Ih52rYFTu7na62j7eWIhCd1a+P+VBh7osVPvSc+YKWL5lku7cSWAuTyfQ7Jt+NiOa65YT91/9XG8y9tf+el88N3UywEbxhIw+2WfQLmNlltIksoKHmObTWgRt7Z6zwm5bz0uJ3eUv+nQU15AspqsZckV5vWWYn9rHh+XgdO70zviHTmO7YSoQodNYKGlsQCtKv2lUGhA11+iRC9RXLUNtCkwhWUPKE/319wY+Paf53rNaDiYq1aUIubctTxRejLrmLJNDnzyJrxX95WDGKzF8WA6Q30xVVGNk9C8kIU0I2XLiJLZBRHaXaWSrru/34qqMQ7FaeV/hwPjSTy1QA3Lg== X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2950; 31:wjAs0tc71l8LNwfoFCMcRnQwiHJkYtApclrCKWhJ7itu0LREKe0EpDkd9IFBuMaS3s8fEWmrillJlm5l2kIKD+Y3CIXWQw9nFroMiwtVtseax4965PPNWiHPifXFJd9cpTXP4+emQ0koOafmVd9YAVutDHZJbTOTDyXd8MHsKr3M8vJin9HwqT4pcoGadFg4NsK1+f4ndr9S9GUqKi/Gt1/tCM4xlSZg40vn2A0qPABn8tsN7OFD3LcfAc/MqDPQ 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)(13015025)(13024025)(13018025)(13023025)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6096035)(20161123563025)(20161123561025)(20161123559025)(20161123556025)(20161123565025); SRVR:CY4PR03MB2950; BCL:0; PCL:0; RULEID:(400006); SRVR:CY4PR03MB2950; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2950; 4:++IkgaSVZdv7LuMPkd7aJtTyLP/O/7L3vbJfEenv8z8cRxFXaFjsOcRs5vc66P5B4FWpq5c39tJn4Kas7DaMzGwfgs635Clmevj3yoOmZxOU2WW8MLpT/Kux+F4MXYClGNRoAlTkgLwih76IaHH7bWI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mJavZuktcy2XNzEa5jGOtYi5uyY8/QPlW6B4BvjrKucEn/ewtizQDTHt1/WlkmMcnXYOfVZlQdsiMYaweCO8YEFLxymsfyzUez9UQfgLJOB4liVLN8n0AAd/tpVQZyXBJ2W1cFt+03I+5HEUWyv5MnOAy4ENerKMj2ipp8BNxKCr6hIHqfJDHa1GelQswxv5z2jQU0/Y+BNt3I2VFIr4z3UXHY8AHI5bf7SrYVigOI1C99aZu7Op8VBayCd0O2d+5MCAOdgHbR4mV3x1baanLqIg== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Mar 2017 14:11:39.3716 (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: CY4PR03MB2950 Subject: [dpdk-dev] [PATCH v4 08/12] 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: Fri, 03 Mar 2017 14:11:43 -0000 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 3f517f4..33396f5 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -1387,12 +1387,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