From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0059.outbound.protection.outlook.com [104.47.33.59]) by dpdk.org (Postfix) with ESMTP id D2443234 for ; Mon, 10 Apr 2017 14:31:55 +0200 (CEST) Received: from BN6PR03CA0017.namprd03.prod.outlook.com (10.168.230.155) by BY2PR03MB394.namprd03.prod.outlook.com (10.141.141.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1019.17; Mon, 10 Apr 2017 12:31:53 +0000 Received: from BN1AFFO11FD047.protection.gbl (2a01:111:f400:7c10::166) by BN6PR03CA0017.outlook.office365.com (2603:10b6:404:23::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1019.17 via Frontend Transport; Mon, 10 Apr 2017 12:31:53 +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 BN1AFFO11FD047.mail.protection.outlook.com (10.58.53.62) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1019.14 via Frontend Transport; Mon, 10 Apr 2017 12:31:53 +0000 Received: from netperf2.ap.freescale.net ([10.232.133.164]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id v3ACVCIU014402; Mon, 10 Apr 2017 05:31:49 -0700 From: To: CC: , , , , , , Akhil Goyal Date: Mon, 10 Apr 2017 18:01:04 +0530 Message-ID: <20170410123108.26305-10-akhil.goyal@nxp.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170410123108.26305-1-akhil.goyal@nxp.com> References: <20170324215754.21751-1-akhil.goyal@nxp.com> <20170410123108.26305-1-akhil.goyal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131363011136920818; (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)(39400400002)(39850400002)(39410400002)(39860400002)(39840400002)(39450400003)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(9170700003)(53936002)(33646002)(86152003)(54906002)(8656002)(189998001)(77096006)(5003940100001)(81166006)(81156014)(38730400002)(8676002)(76176999)(50986999)(4326008)(110136004)(47776003)(69596002)(106466001)(2351001)(105606002)(5660300001)(50466002)(36756003)(48376002)(6666003)(356003)(86362001)(85426001)(2876002)(2950100002)(50226002)(305945005)(104016004)(6916009)(8936002)(2906002)(1076002); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR03MB394; H:az84smr01.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; A:1; MX:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD047; 1:Af5XZCYyq/LHkTDZFayv+iU9vNtGcac0peQfwql6n9JwjgRC6pshOh78dfC53CBGhX0JH9hLglPnK3/b3stIaJlKI9ruxf0KOGcEHOgOo/MClIrsfmPxH0mI1MHGXgkML0WSX9S78x/A7MskZf7S/hZgfdKIO9o854I4MmYllcKIVZB6vDrCvmYJGkC7mSQU/jt4dJ8Rr6DGawECZfjlJYCZdiF9mCa3XW5lIY8Giji+0rbuTtt13xTYYC6OvNXhgKyxgzgbAMuPWukpHf/NtJEevzkcYZm6ZhuQetFKOaN0xTdEWJRmL1ifQ8REEI79ryjNJqUGW4z3OgO5StCoJ26tEHtZ2MrS1uKwGc8HluGbLfS1MeJlqxw9zgzteVPydtLAcEbxLvHW+x8F41Zy0C60hft1wcGYFzgr6qF5VwdGkclDsvAMjOGwvLAh2SaDQZr8+loifUapuVnS0dAV3BijaFoapcnZEqLBVF3REcY+f86xm3YZSRiP+myFzh1Xd4yOnco3VJXbft6KDj64MTGRdXTdS22x7RuyGtYe4bBq24bBX65Tc31QCLRxFfs1YviCsjL/dhiGsr3mAfmOkx9seGFZjSDxoIo0SxE7N6VoknaLdR0pR/Zo5CjUkJJYffCXyCw472Xzz3fZqNejDjKpA6oKtUB6ZkTCWnV6HKDLmPOEqnWmh/fW3XrsSRr1yKwDaCJt4qJzaM+ZJrXWFkDu+cbKIsVLLaBMhtH+AKcLjXPntquzbriExgM9jvLC71/bZGoA1t8Q2dWqgWzkBA== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 6af57e86-ce46-4ef5-bb93-08d4800d91e5 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131430075)(201703131517081); SRVR:BY2PR03MB394; X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB394; 3:6czzcgzhKjuscDCMr+FRHxwXkSTVGJdhIuBYyMqXzvsD8yPJs2aLsCpyCQyd9iu4E//OJSrPGWRMqYnGwPukUO5dT2MOD4J5JEmClhnFkypdDSH0G4jEyMX/a+HEIiSn5OkHH8SRXgB07a/DNAQ0QLunCdBLX29r17mBlU9Q6iRsUTNOJ/jcm5V1t57+gY6x5wOkHrCCpEBjXLzGXjOAbtQER/w4C+kkWGqoLyI8guTS8VNJQaucDjEXpooWMRAorSIG1puhng+ueFkeQe1LjknMUQVNXGGvjcOaRSCg+xK02dg939B8m2vJLBC4MgeGeedvjjeO6DkqSId6m5Ba80ptWmyyKmjqYJRQPeuBioshFFi9zwCaiK+6at9rVkSBxG2f88oKJKbAZhL64K9cna3K02BliAm8NkBfDcvfuqFqyIF/+FwggcEIcmPLiC0e; 25:S2gE2BUFs2m2YguRgREHvf9N45TK1C4O7YfMlMg6DwAryVyxcBtY65sn2mMQ1F4ZXIYxmX1RRjwEeD2HdkDba0YPTPjyGDycju0H10LOXeeYHztBy2fTGjKvhz/xvyqxtdpqdtw0uvEGiDq/s4tOxf2W+c2kmkCkTaQwOHexPQuncpx/J03ujYEXzTW8AltVOyFFL1FYRjCq8+2/LQaPWudBo9zS4UeO2w+bVXtiRKW2830D2odX6hGpkYT7ri1kSgDdGO9GCFKzXtdOgmgirC2T6+Jb+bhbyoFTV+FSYfqUWTf7hNTnDDOzthJMSuEzH9RYn69tXzpYlL3SLIKLDvVOFDpgNx0murWduLaK2RyGPT6a9B2bCMUGYjf4z5pKRyhnwYubHVBhvdtN+/JkowOC9X2YJMW4I2bCpVebgLYvth3L8UWO1NbeVqMs/kc3FJuA9WGVLWoxhruLqt94zQ== X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB394; 31:OtkMVhkhFpuPn0ie6Rc8D70KwoZxa1E+0CMjgAms8MxDbMspnnsXZ7DPw9Oh1qwn8Q/mWl1lMF5eTDsR0hXdPjQO+cbeEIiZg1EWpO43tANprD7k5vQcRtY83tJL2g5tbHtWq66i/QCOKwHrbK0zKYS+LVDsxtnTuNvkuZeAVdbM+z6ObOK1lwoIv8DzOGUoWPmG6DLPfmePImGh804iqgh74FvF/wAhc7WQADnx6fkxYA3PzlBID8kXgRDLP/kR 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)(8121501046)(5005006)(13018025)(13017025)(13024025)(13023025)(93006095)(93001095)(10201501046)(3002001)(6055026)(6096035)(20161123563025)(20161123565025)(20161123561025)(201703131430075)(201703131448075)(201703131433075)(201703161259075)(20161123556025); SRVR:BY2PR03MB394; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR03MB394; X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB394; 4:pu03/RdI0c/ofpqlqOXMggTcpNYxDY1WLW1pn04WlEcrWCD8BbETIm9hUw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z80Py6; 24:ljXc7fW6OeW8dmYdXi0qx2E7jVMlhgkc5OO5s4J4QFOqTsbl70+M0XQbo03mX2ds9OQYPsHSQp0b/2mUmRjauwOQ+0QuA6lhuBzSAr/VkVI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB394; 7:wX15y7ftUuUATOz12eKKcChXenOXVFj0HLV7AqRMaJ0h2Xz+tAErlIDCNelG5nvnysoJLQpudGaxeQXGOGcr4dG66Sxaar9kDc8MjFbGbxdwZARWL2eZFFPdJ8gOq9lUiryI+PngDEaF8XkJROUs/Fh3ctgEJSgks8BX0htJeH3CHxPC7ip1LjhBSlbe1VdPlNHgx+nm7VoZgt8ST+yF8oD7R/j9vD2rlm+7cRc7DlRdzpIcMxU6LiUeYhR6q+bxxczhLg3ljayuu8mwM9PkGtJX/8nIz/uxiW84tWiaiElyvkT/H8QQisgoYvV1hn7iOUFnoNlzNIa0vIYp0bYPHQ== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Apr 2017 12:31:53.4424 (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: BY2PR03MB394 Subject: [dpdk-dev] [PATCH v7 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: Mon, 10 Apr 2017 12:31:56 -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 29346df..c8971c0 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -1389,12 +1389,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