From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0057.outbound.protection.outlook.com [104.47.37.57]) by dpdk.org (Postfix) with ESMTP id 1D7BC2B9B for ; Fri, 20 Jan 2017 09:39:52 +0100 (CET) Received: from CY1PR03CA0032.namprd03.prod.outlook.com (10.174.128.42) by BN1PR0301MB0740.namprd03.prod.outlook.com (10.160.78.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13; Fri, 20 Jan 2017 08:39:51 +0000 Received: from BL2FFO11FD019.protection.gbl (2a01:111:f400:7c09::162) by CY1PR03CA0032.outlook.office365.com (2603:10b6:600::42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13 via Frontend Transport; Fri, 20 Jan 2017 08:39:50 +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 BL2FFO11FD019.mail.protection.outlook.com (10.173.161.37) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.803.8 via Frontend Transport; Fri, 20 Jan 2017 08:39:49 +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 v0K8dNVE021447; Fri, 20 Jan 2017 01:39:46 -0700 From: To: CC: , , , , , Akhil Goyal Date: Fri, 20 Jan 2017 19:35:06 +0530 Message-ID: <20170120140509.4495-8-akhil.goyal@nxp.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170120140509.4495-1-akhil.goyal@nxp.com> References: <20161222201700.20020-1-akhil.goyal@nxp.com> <20170120140509.4495-1-akhil.goyal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131293751899813968; (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)(336005)(39860400002)(39380400002)(39840400002)(39400400002)(39450400003)(39850400002)(39410400002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(54906002)(6916009)(6666003)(92566002)(626004)(50986999)(110136003)(36756003)(4326007)(2950100002)(50466002)(2906002)(47776003)(76176999)(85426001)(5003940100001)(48376002)(105606002)(305945005)(8676002)(189998001)(50226002)(8936002)(33646002)(5660300001)(1076002)(81156014)(356003)(97736004)(81166006)(77096006)(86362001)(2351001)(86152003)(104016004)(68736007)(106466001)(38730400001)(53936002)(2876002)(8656002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR0301MB0740; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD019; 1:kur28kgdusX/3GcECLOdZAINiAjggltB+il4RPxbyndGRK8ftrYF2NdgFZRIJreV+vt/7Va18XkqlAIx1qTr7rynLajvc0zlbBmKiYFHIsqEqKsQmltkvMUq8lOu0HNuXjOygEj7hL/3g0rPps289+ny//EWdIUMNBtvPHaJpw6eW9lfLeoW1dfQrnz1T5o+j8AyZ3W/BRH55ybxlgRfd9mes+nyYI2WggQ62mAV/CgpMueno3tEbYDReohGqkfZHpGvt0OuT5Q4IOo3IlsEz2rC88mlnVCQKkvVlaoX/tdoxJwJGKJqZX0vHLBkYbqyAEvCrcUywSz7IfRKk7ffY3X60opSFJkeiRG+Fbopc2DXGYbAZiYKjhy5XX0pel9IlhCSO75+uFJ532+H7/fG1FIl4QKlzLincZ2dvyQbXoLHkeXN4lmLrhPy42BoU460eRmOk7vi7tVwM/asEBdUa2cWBzAJ9zdPegW2iXD3QMoRMMMUXihH03QlbVbXq/YntF3BqIC9BP9FhW55thxIipGtp96He76QfvqQvFW49mcvbo9n7hkF4ay3NoawifZUikYJnVobc9rd80g7CS+nSxie/yDEFr6J5P6SYMaUdaOZwGlGw1C1A8FYPrf+ZIRJXqfyDucczVNnRCJzG05Qt7clm3Ol5AHMf23MueD+Az9DbrxJUzkz9x1SmYgVzg8AMj6ejBKJf5dVVU9Q4Qn6A6MXiy1WChlhAPYF8/PIGYyU7T4m64ZLtBPI7gz+/FBO MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 32652152-be6a-4ef2-0be7-08d4410fe599 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN1PR0301MB0740; X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0740; 3:gIjdykuVUz7HQh3Yl8NEeExctRYqBW728ngVOZXfhEQycZ/7XJmbFFxlMk/VEckgiA+2JVuA/AZ4Ko72StmSxnz8UK0RbuQv6JqMF/m1QEZJndHu7q2CMovKElNDGO1WdsIJvNJ64yEeL0Rq7z6ztphaqbrzaZyx5ConfnmcxxmO/0CgSJglrQDMLrMJHyzDHH6dsnyEkLEuYQBIQACRnHqrIE49N69/f5ujKfuNi5IB0LyJt452iAcRSlLKrZ1qycVGmjEDmDRSsfZLAGn2XJcLU2bF29cuYcA2lDO8wr4YwZhxhwEN0Bugh4rm65Fa2Pr3oroKbRBtMPrtrDBx35enbX+Xsn4Ql7t/u/hqqrGV10zMcolSfhEzHCT7m0CB; 25:SASi2JPYJINdTYxmcu+5y6Kr8lU6IVYfnbZ53zctPDfd9TgTiUXUH7nZsVrUFxhKyMLSOTN1UrGsk+q+fBKwVrnHVZpyPhg14JtkFoxcj2GU9KUF34OK5hxX0+gkL7x4KbK/CpNQe8Sj33/Vjei939ybAw9BD+vgPDOzAqjy/v7rGPCiODBUUcr7Svph30N+D3lWqbH0Gj45jsiQ359LKb6FmxoHzxpuWEVl8OEwFeOFj1bJaV1CmaKCLaeGam5SI3tEmcmRQdBr8N32VOpRuKmIeYz/zr/hPvQXoXrdkx5IIGqXfqzMUgqfEAZBEQ1/RE49RyWiGXgYcfWpDlKzzYBiFvjL7dOphSMo7fDjZbx+zYA7/9k7Gtgus0dN1+SUFHKyHthcTYWNEQFNy+1pvJzgPwowhm9mmxJJX0kV3pxxS/o9Kled1D+m4/sTgDUe2s7NA63W3NOXLhmN8wij9A== X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0740; 31:t4dG+XjeZX2YBI+ZC2mPJAQlFsKOVDrS23/4T892i5SS2eGo1UyLp+tM5QhLCsvcBpOCbJDUyoUWwYU7tB9GHp2WasYcOBg4SEeny7zEI+Bkd5pxMcyjNVVZ/TLQFjlBFPAvS9AvJpztDFEohrLEmJOPiB1H2T3bo3zsLYQEZ6SH4lNAqgW8SDor/udQrrNUimzmi64wdQVxZ4B3ee3hYdJMUiEK9Fs5qEdhnisKYXyLnXrnpAQEKTxhp6SxB66py7fO9o290vxHkKS8ryAljw== 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)(5005006)(8121501046)(13017025)(13024025)(13023025)(13015025)(13018025)(10201501046)(3002001)(6055026)(6096035)(20161123565025)(20161123559025)(20161123563025)(20161123556025)(20161123561025); SRVR:BN1PR0301MB0740; BCL:0; PCL:0; RULEID:(400006); SRVR:BN1PR0301MB0740; X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0740; 4:5PJpa0CQfigyzIh2DmLfZl6XkNsI9Z+qI7NTBkcRtyBCejwCBLIdNxPw0XYufsCLppwtqnGb304IGhcka3x+JANu/WpBEDnZ4KsInaIodEO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K94U5Ih1hEh6pfPRk0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0740; 7:dN0QkNJ3ipJrUopNZPiiYl7VyfOgDp6AouAufLylFhg5sie4QpzNRHqZdtczmSRJ9rMeKU+tVd+n3V+8Kl8tgftR7ZZq9XIxlLATu3xrgaXsjWn0zFcf/5U2ao7FUpTSEX2s/1z22EN+V3qkudLxlMACgOlhjkBEaNtCkNG6/fsblQ+fd9Szvyor+HRJ/h9GEAhZUqd1jsUE56fM1Bmj9oKHZih34X8mybxyJEbWnmcrnP40SCE1rSDlbpUpKX9gh21C8e1l2dgPjPiEeYPW+EaNQrHhaIMBpGqc3s4K6SHxBaS59Zey+qxqYHXM0YDoeCvCB8Fsz5vVW1q4yRooGKeZ5LSTle3KZcncUT0JJ1R0r4wOAqBRw6xFVL24TO6qycLx8qCx/RFh3pkOLjpUn/eYqO/Lsr8AiyUMt52r7B47ndEgdnf/nJ2IzWfwkkZo9GzA9/UPPwTz8W/goqmUrQ== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jan 2017 08:39:49.6693 (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: BN1PR0301MB0740 Subject: [dpdk-dev] [PATCH v3 07/10] 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, 20 Jan 2017 08:39:53 -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 26ece22..c863bd0 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