From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0074.outbound.protection.outlook.com [104.47.41.74]) by dpdk.org (Postfix) with ESMTP id A0876D202 for ; Fri, 24 Mar 2017 22:59:04 +0100 (CET) Received: from DM5PR03CA0016.namprd03.prod.outlook.com (10.175.104.26) by SN2PR03MB2269.namprd03.prod.outlook.com (10.166.210.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.961.17; Fri, 24 Mar 2017 21:59:03 +0000 Received: from BN1BFFO11FD045.protection.gbl (2a01:111:f400:7c10::1:137) by DM5PR03CA0016.outlook.office365.com (2603:10b6:3:118::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.991.14 via Frontend Transport; Fri, 24 Mar 2017 21:59:03 +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 BN1BFFO11FD045.mail.protection.outlook.com (10.58.145.0) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.977.7 via Frontend Transport; Fri, 24 Mar 2017 21:59:03 +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 v2OLwRmm007000; Fri, 24 Mar 2017 14:58:59 -0700 From: To: CC: , , , , , , Akhil Goyal Date: Sat, 25 Mar 2017 03:27:50 +0530 Message-ID: <20170324215754.21751-10-akhil.goyal@nxp.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170324215754.21751-1-akhil.goyal@nxp.com> References: <20170303194935.30831-1-akhil.goyal@nxp.com> <20170324215754.21751-1-akhil.goyal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131348663433710586; (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)(39450400003)(39840400002)(39860400002)(39400400002)(39380400002)(39410400002)(39850400002)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(9170700003)(76176999)(86362001)(2351001)(6666003)(48376002)(106466001)(8656002)(5660300001)(8676002)(105606002)(86152003)(5003940100001)(305945005)(54906002)(6916009)(50226002)(2950100002)(53936002)(38730400002)(8936002)(81166006)(47776003)(4326008)(104016004)(1076002)(33646002)(50466002)(2906002)(2876002)(85426001)(77096006)(50986999)(36756003)(189998001)(110136004)(356003); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR03MB2269; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; MX:1; A:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD045; 1:fvRW1BcYGCMavqf23scDKkKPKaWkTwrd28bAN4ElQ0H6a9ozj8/ngmtUCWGPgrOP/v28hwbjmPT5Az1uN53GvSyhL6sQGZtmlIE6i8mZ8aL4qDuiJ4w0hF9CNEmVd3LeYDjqkwGznUgVcffQCkde0Kna5VftCfx84k6ziMyT9jqsqWflxZMJ4hHqjFZE+TvQ2vm32OLMXohbgUyWaQURtMyLjLF7FhPz2Oahl7q83DgEtb2dKO71r/l8KBGHjz3Ew4b2/NGAcbmAoxLbljuLNcsCABtRAYnLAqWtaHe1FSdejv8MZB1cmh9WWez0g+QfNydRcZmRC1ll61VVRlNXI8rYXmL4RCI5ljYij6Sgkw172rgNwEti+nPxH1OthjboTWK0hSTnXjoDWJXQi53jD7iU78NoWbGoZXnNDI+hQ8Fzrsn9ceX2izb/5hw1rUYiGmpArHwyV59dLVtUURmWJOOT/qUXg/8pMvxUqQDeE5lmpj/sXUBW+qU5/8YuoUBgyGVkief8xgrmKb+Ftw9RC/HUeR9elBZDJZjM0r2zrH5UoGkZfyrX9z9gXlOJElyllsDRICU0A11+yxEdoZPbjJIvMxpMQiOw3S69a+8hWqHYR2JaBPciqywInU2PMdDGzfia2687Ee3wB2wUsGGL4RhU97Y1qNHmxmV0IbQJ6mrd5ZQiVs9eWljGMQSi3+k9yvH3536A+1Sv8LiQ1dn7zS8Wm/plTROt70pv5SIYfKwZF2qbDr+n99ZwpckSnaNQ MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 62d87b8b-968f-4442-ea9b-08d47300fc24 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:SN2PR03MB2269; X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2269; 3:zr/8GepUxY4Gol48/No1lEKIb5FTwwAJJ2Bkk7eQgSRLrJEeKHqEWx7q9a3sEtemIMhvjO0JRd3+5zFL0MtDnQ9r6pPZmo1K0liGQmTh6TiCo7YKoaA5kjK/tO87b/E4lVnBL2OzvRhniY+d2loI4CD12rmV3J0+dmBryQKGZGN5Swou3UIUmLWO4GkFiWjtB4Cav17H41DzHJr398hSbasIDkJxM1g7tV75DjDlFjF6oW+YcAVpi2hg0xR4TnhxJ8V9lpF4qaQUuVaZj8NWCEPu1+kWKFDNJxhun1aC4DpdhjF1wplclnIR3/QzoAtDEKswFk1HiQusN3Gh/SgsPIo7YtOakq/ISkoImdz127Ua0y3XRjB2xF6++dorkxI3; 25:uaxXxOkNB0KL2hrnjqtyuQ2O1NQmFZZX/z+qoohguqMOJktj6LIH1qCG8Kt1I9XYjpr4LAopY5kyxRMs5iRRAio8g+REkzWGr9YGO248LE75buwbn3zJRzkW7DNCEPZrrmhLbTaRonaNUg/OFfzVj6x6On0FSVRHc+bHHwgsV9/DgABAVOX1YfLClHzdtJiecHyXGPw7FBDtzkCUxbLbC751o+bR1FEj1VXdGOvVoFrwUtC/cR+qNP6NjAT1MwNIOeA7QEjj2Ig0kHz7B4+SCCO2g9vo5C5IgLHbanWGoinYWxONFsAKcbTqCYDBTGgMGHJ8rvQARoQDjGmzEX3P7R5KFUqHlY2IqIf5qGiraH2htse0+NaSUGU8j6O+g56w/C0ymQAGXheYT3/srjDpQ2hPNTBkjAUs3ss/lw9q1U9LaYk51zQVNHH/k5NsRgDvAVaD5LvaTB51nNwWN47mPg== X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2269; 31:M9meAeHu8PT92qb7xoi/9H391KjV+126rDctmSHhUsYuVg8zN96BunO5mHWGtq0Yq6FvucMQTzPBuGctnmyqHZkQQp28ODU6f0fPeAxqnXVmcW7zPxH0yZfjU/gLCZRrjG+JRXyrSI2gw/4iTnZs/pipxrVLGDAdmS5oY0w3jiPLK1cGXjjP8W0HgUfOXi/9R8Sxa4S4rMH+hV6QUxk9io/U0BwPK24fdo24i+6Z/Lh4q9bF5o/m6JpJjq1UNDC1 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)(8121501046)(13024025)(13015025)(13023025)(13018025)(5005006)(3002001)(10201501046)(6055026)(6096035)(20161123565025)(20161123556025)(20161123563025)(20161123561025)(20161123559025); SRVR:SN2PR03MB2269; BCL:0; PCL:0; RULEID:(400006); SRVR:SN2PR03MB2269; X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2269; 4:ToEPYgVizyLH4wmg4qVsy3l7Ew9PTtgXgDOgGZ34L+I+QBYkxFyvhuOxhoA2iOBmF6DpXLFbGlM7GfPi/fgFqACl5MqlWKU8LbJ6eun1vqpMuPOuKxbLKJYlb2G9SYDWNoZNLF+EgUPAM+AGbI1yTEBDcqPOn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YSqi48BvjXfBw7ILFdc5XjC4B9x2YPQ7r3T199AS5q5mc9qG+/UxTvVuTcMTiFSc/fKwRzTSnXdza8kMx4r6c0zfmQ7HTQjDIlT+GF7X3crsWZapXQE3zFBXP8sjGPZnLxmoUTFzNc0BsudLyvEEOAmwlpZ9OpCc/X0G2lThub4TDURO6WuFZXtdUXMlFoxX3mmXtQ3oLsdXAcNd1rNJQ== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Mar 2017 21:59:03.1838 (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: SN2PR03MB2269 Subject: [dpdk-dev] [PATCH v6 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: Fri, 24 Mar 2017 21:59:05 -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 d45797f..0e5fc10 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -1388,12 +1388,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