From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0084.outbound.protection.outlook.com [104.47.32.84]) by dpdk.org (Postfix) with ESMTP id 4B08DD4CE for ; Fri, 3 Mar 2017 15:24:17 +0100 (CET) Received: from CY4PR03CA0022.namprd03.prod.outlook.com (10.168.162.32) by CY4PR03MB2949.namprd03.prod.outlook.com (10.175.116.139) 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:24:16 +0000 Received: from BL2FFO11FD005.protection.gbl (2a01:111:f400:7c09::169) by CY4PR03CA0022.outlook.office365.com (2603:10b6:903:33::32) 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:24:15 +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 BL2FFO11FD005.mail.protection.outlook.com (10.173.161.1) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.933.11 via Frontend Transport; Fri, 3 Mar 2017 14:24:15 +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 v23ENi6b000351; Fri, 3 Mar 2017 07:24:12 -0700 From: Akhil Goyal To: CC: , , , , , , Akhil Goyal Date: Sat, 4 Mar 2017 01:19:31 +0530 Message-ID: <20170303194935.30831-9-akhil.goyal@nxp.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170303194935.30831-1-akhil.goyal@nxp.com> References: <20170303193648.30665-1-akhil.goyal@nxp.com> <20170303194935.30831-1-akhil.goyal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131330246556705186; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(979002)(6009001)(7916002)(336005)(39380400002)(39850400002)(39400400002)(39450400003)(39410400002)(39840400002)(39860400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(9170700003)(2906002)(6666003)(2351001)(47776003)(6916009)(81166006)(48376002)(2950100002)(305945005)(8676002)(4326008)(92566002)(54906002)(106466001)(76176999)(5003940100001)(53936002)(50986999)(8656002)(105606002)(77096006)(38730400002)(50226002)(110136004)(356003)(104016004)(85426001)(8936002)(33646002)(50466002)(626004)(1076002)(36756003)(86362001)(189998001)(5660300001)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB2949; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; A:1; MX:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD005; 1:ttjzvOLWGaoxEMFn9xWkjpvenksm8PT3BO54wCyapJRUW7osc84Kk7O5rcoEuMBbyrgfpjNbYfey8CmKW94ZRswuxHIKjzigUO1I8INcKtl8w7qKW3oLN/qcPay7P11kMQDjMD2J/2t8/j9gehZfQlaReZ1m9v8OWC7CQ/OOHw4oG775LaQqEE1EZ1hnoxq9NGgTxXso/bqCQ7P/zGBNK5nkPZmk5PXwCJaeRE9cA0nbjyD1RUUT7X/8Ogs2X2KmfWyslt6ONaTGpOUHO/6Fyh8VKQE73s5wOfZfT86T8V5ufS630F13Ko7PIIkDwH1ebkACewJc1zrNEht00lw7/cdtdh3rs5oUYYdKoU6I2XoH7akXQ4HNQf/dca/F3sSkAp6ItKYCRThRtjuEZHOIIK9kDHwhDmDN6kpo8xg5c7sCj1kmgqej2k+1VNavDpNdPkSpB6aGpBQeKjrfE7cP74SyjLPN7LYApKRHA52kaBRB4moUPum4cRUQRlT9VQVRwQBvV9QRJ68ufFXLGmitkDDm2IxN8mkTm5IA9GuPCFemXF26GUjQkpjwcZDsHUcuN6KSM0QYIshFXfduqumavvV3oezm5W9r+uirR2GIyezBPgQo58XRZkNFEygTHguuU8Cn4t5Iplix+jQjpds+HFMoVdHlinRpXq7VIt46599CiYZs3osP7NYd3aIB7N3+ERNr1q0KBvlrbHwpBdqkSPEPVv2YstjY0erWCBEXJycxQMHm2e2WtAjGKbJaIfMV MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: c9e94efb-91b1-43df-e1a2-08d46240f8bd X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY4PR03MB2949; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2949; 3:OvKYgg+AHLyojbV2cIM/oTqmzInzl7VnhGAuQ0L9hYnR+lgRNhGT9KCZASCSQTyd5Wsy6l8RcX1zaHRS7lUgcZvwpxkKxVNA33HfvItSUaTWgaijZWMr5VRPo16gAaVw1YpN6SUvQbw1QQmMaYbZYRMr2V4v/5BpjKXxJ+WJ4rhlDNwMB9kwm6OLH1XMzqpf1xYlGXNlZ5tbGoqlbMvrTmmLH3ts3xBllD1ux8SoyG8qxk2u+37g78OK4DM11CLwYIEdn0LleF2hQD5efZsxeF1EZEoJWhECD/bf7KAmAF8xumQflKzVuFjLlMbzaHlhBUpMl+lb67avtbJejTEfPbS1j8s8/SGJ5ZgydtDl/gaqgQM12IxhYVtIo0zIe9xK; 25:QI7hTWqiEQDkrUgGujyfhJlon81MQ84OApd7Ric90caIR5QYT/OFGIZXCBk7AA8vIExpWqebyCgk3Y5lfP4aT7VvHhuPfidUt5/vWdakVPeTawdTAAEiPRt4zyJrzpw4LhdkFxMQuULX/uzfXB+/O+3WoPMMUMkF1PrzDW3mhMxJ/mG9aCXGndOugX4ow05YG+iDTGw/qmcPzKUnxy7ABM2IDfMan1y2sTrKpN2kE1wfIMfJjKOYLiFg2wnG7t1r+JheYKHrxRC+GkmtFevD6ZxlxXSPiWDZYwufkn5fKCKXsY4+8Ph1068yYDC3Xn7SyLrCs4gw4s5GcfYsp2YS2I7x9pOBga5T+/YhZA1InLRowppbrzNtWoF1oWA1gWzl4Frqh30aaU5fnEZHk3i/yDcdIS0RYD1Cx7LqZtLm1YItEPOOPs5COAshlbn2xMzRVZ12xy7Z93XyPp5DVBibkQ== X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2949; 31:P83RTtchV8XmqoDsf+oiu3swZM5WRdImnfkOLBjzk6F4krgMBTGxbxW4AIMg4wznufO8cd86OrQNGp+FYc72EyTKPWaVZy/zUp+2TTkNcbsRWzHZtOoJVo3weT13vhAC8JSV9RcORGdYGqXRU6VI5qGk32yVf6AG1Py7T6T0cPc2PkKIngQQ3RMoTdXULGvWNRgk51MEjiM5t89m0GgBKWaFhY4jw/GWxSs4IFLrSXZ4Yyic2FI5hINHhrgoL8DeQrAa/QbdWdPY0We/8rWRlA== 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)(13023025)(8121501046)(5005006)(13018025)(3002001)(10201501046)(6055026)(6096035)(20161123561025)(20161123556025)(20161123565025)(20161123559025)(20161123563025); SRVR:CY4PR03MB2949; BCL:0; PCL:0; RULEID:(400006); SRVR:CY4PR03MB2949; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2949; 4:/3ZHiiTWNT/52Vxi9umCfSLf6uOTU6btFmVs4+zxXqaCW4eqFFtqsd5/MZplb4eJRv0C/EkBQLRu292R6osC53pOmvHzEfw96SV8Sf8XyjIC3aum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IirTF3sJyqFhX?= =?us-ascii?Q?BZjLe3PU+Vrd1QDCHGq5+JmVZrNa5Q3wds6GhEliYxcpCE5wt7S+Pv530SKZ?= =?us-ascii?Q?ZA/MX7CL3YoLD0ahXP37TpJWS1rsQcyQCjSEr5bOQg6fJoF3COICLxyuNcVs?= =?us-ascii?Q?tH6eO7nk1SMctKqervQn4iP5lj2xmuiZTaEvOCumRqpe+PeTrJmCVvSkW3Sa?= =?us-ascii?Q?cwo0fCOSakn5sdQRqsudVqQqJU=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2949; 6:PMQEXmfbE52iixyPWmIna05vcinxDPSOYRHjoCkyga8sT3r/Uj73T4W/THP0nbDdeAsuaJK5bQl2pdEvub5ZDfwTP7NVZsoOY3ADTOzKYtbUGjYjQE8rddFNdj023YfrBGGVGjnRTbgon2PB8t462jT+l5UAp60ziejq5miitZKcae4RhS+x7Ba0gIbLNc4zMY8JkND0VRNJV75WwO10XivSTbv5AKl46q8bZ8U76/axGLhxkWVvYvWTehXj78y8c2vOMD8mPgemAsluzwm1NptHevwBwNbUhHwUdjquoXuEZeXqOSlhSyOWNwidmKFRgStEXAFpTRyB+6GEwf1DoNlzqFputORCmq29al9pdPjd+YvB9AddZTXTkKlq+TRAOCY/mQ0OkJyfaeIylhnQb3o68RWp4SHTVNAXV5LxjWw=; 5:rfbKZwLEW4ESnLhCu8V5VvSKDqIaWFMh+PYj9vd3+jBfdChiiIz1joa2gxvYsDQse1FMlfQy8/MA+2jlkAZ+YiBW1ombfbmPm5IY0vi4REHJKO0bkLTqDhOcQAnwBAldV9UIetvhwv/UHXG2pu2uCamBPvSIf1xmtW09Wn67SdA90g2SeLRvueCXAmwDKdi8; 24:I13yKhy6gqLazkz/iA7zjNayFvFIhhOczvYdUZvF9gVABu4x9f3jxxbtAj0TKoRteH6NPMWbDOaDksFo00up4cCfVCOwpF86N3jFi49JHkE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2949; 7:+qdjjSxRqIejB5NaRrEEpDHtFUCEjHd0MjYxOHSf2iTRNMv68itMest3J/j43u9eid/JNnxij1IY46ofimGqyF9NOqoxVLI2VEKVwmYSuG6zwTcPZyhndTBQEQzLpXvyKM77F06hSmQzWylnDMxMKB6IwXRIOuR3kNcgmXM9g0kB6LLCI/4ZNx+9zmx7WI6LhaI+qv2Rbt/BM+XOnwMe3l4ur49Ww+Jt4hGnPDECoFFwOdqSL2ZqfxnJMmYg7JaoaatuaN2TdZyxTMW8VyjMTOuUbrsntFptFOkN2P1FOdyDepxyHDdtIWe9Vm4TDG+RZr/Tk3m48VxTax9nplP6Xw== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Mar 2017 14:24:15.4833 (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: CY4PR03MB2949 Subject: [dpdk-dev] [PATCH v5 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:24:17 -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