From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50047.outbound.protection.outlook.com [40.107.5.47]) by dpdk.org (Postfix) with ESMTP id 68F8E1B959 for ; Fri, 12 Oct 2018 16:41:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oSP3fQmcKZAfWVkNQdSs+HGpeZfipb6O19rI5ne/7RM=; b=MQjFUgd3d15e9JRi2FdK1g8bjEu97H68zsZcpgHiXwGBMjJp3ToW3HHLPmol/9gKRTaOUQJdWPnvPFS+ZSw+D8TlHWcxk7j+DAcw6hwMu9QZT20ylc6UJjT0GiNRS3q6jntnYyigdxLyIN/hB/Yp32/i/07IeCBVwtPplCMEB8w= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=G.Singh@nxp.com; Received: from Tophie.ap.freescale.net (14.142.187.166) by HE1PR04MB1530.eurprd04.prod.outlook.com (2a01:111:e400:59a8::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.23; Fri, 12 Oct 2018 14:41:53 +0000 From: Gagandeep Singh To: dev@dpdk.org, akhil.goyal@nxp.com Cc: Hemant Agrawal , Gagandeep Singh Date: Fri, 12 Oct 2018 20:10:53 +0530 Message-Id: <20181012144055.9461-13-g.singh@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181012144055.9461-1-g.singh@nxp.com> References: <20180913060846.29930-1-g.singh@nxp.com> <20181012144055.9461-1-g.singh@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: PN1PR0101CA0039.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:c::25) To HE1PR04MB1530.eurprd04.prod.outlook.com (2a01:111:e400:59a8::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 26d03462-7955-410d-b9f6-08d63050daed X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:HE1PR04MB1530; X-Microsoft-Exchange-Diagnostics: 1; HE1PR04MB1530; 3:qcHsjhrpQU6lz5SV21BvRjN1vuCGl1c8/x7EbdeSydK/8OTmCvCNmeR4dlsHRgymlxgC63xvmLAXEShDC5KOEo27tLIIrfJly5EuAu9L7mA0TXnI/vG1HK+rup8vVUDK7lwGR+vetYMC9Kpfo0SSONeKtIjEF4TOflAuox68O71p8wW3CpHEp7R7MfoOALtgamjxosOGP4koSH7/MgooLou5y78wnBaRmWZp1g1NgoQdNPde0/HTF5Egb5vvYcWQ; 25:TSH9+vD/MpZdQjdHGGzSh0fwRCGVyTLr6KywBgVFGSxSFP28FYDNpv/VqjqWf3IiEq02T0UT7qW1rCFTZFBV7k0hmwX2n5wzkIfB7Prk8BGTZGCHskkTVFDcRpNlTtB/MpAftjKzb01UAKNZfthJnqhnO//FpC6TKBtqeuLSvTP5113q4w4LUeP9ZZCYO0JZPk1uY9tpFsgSUhSPY+Rgfso5EkXRq51nwrl1FLTsfwF8oJ4fI6JLnx8Hx798KcsFPDjPf0elkztTWIIkU0Nyjbn3RVtWzZJ42F8IAwdwnkWxRsyozMvx/jQtehkR/rECdLKv/RbiGJ1+iPnwmEC0sw==; 31:OSumucgvAMUoGMtyHjIjhc3L2Ik75toxwrvsvOmnTxiDndUB1kX+u2x2wnfAl/IfVpsS3ME0Mj9lhIJJ/qK0HajeHTUrfompcYBx9vCVg7Nzpy0GR73rZgBulB4MSDk90eOBhasU9SrhTJMKL1vG9HEktGLXxJM1AIiPRx/1BWf5YTTP1U3CD8CcR+iJsTBYiJ80U/rDvCfJEzbcsa4gZSyoILg3FHXfmXT2OG1ZLZU= X-MS-TrafficTypeDiagnostic: HE1PR04MB1530: X-Microsoft-Exchange-Diagnostics: 1; HE1PR04MB1530; 20:9h26VVfF0ZxVl0zkt2jpHTJyCfwRNNbzyAzRrt3ZVrQD4EbyjWA58SuyWbUdILRrM67gFUanhBn+ibpOJvCaHiRraZ5VxTkW+gbrnD/kWrUnsmZm18ofclJo21yrmN/+HAudsVwgmeuEr1AllZg5JU+Ze7i5kr4+8H6IjcY/0mPxZcE4gB5oXFNsTpMt8tImMnIaI+1Kpj1A9IU9A4eSE918C82XmvHsLKQnqZM8/35jfumvHjelfwdX+cBmkwux049FlXGt8IwdSwSLv2GF425c7erM996IvGqKfyCz3f3GQ5GYYd+3PelY1jIhHzesRmYzioiuUPNPWoXt7M5LyHkeNc1FLPLOYgjzsvAA9FM0R2KzJHC6yxxcQcmnkOiRBx0bH98OsGJ4lPDyKRqofeTP08grBrt42n9UMmO+/De9OidB6Rc4nVsabxFP9w2BXwV268LY7fjxqcPf3Bql2viPfjfqtXBwHU30BbXU2vMaUU6mcVoq/HTxMv62OZnI; 4:vxFKPbLdJw0VMHTz7gpT47cyfqHYrQ6zuCKSbWCfleSCFS9wsAnWXTMjYg8Ilcsa3Ue7IFXVoc81Of5chWvth1H2nbvSiymbjBaiSKzmCWaU1OY+2Kbg8DlTwohWywf7nEdupfunWDGyA7roAYWoLQtaudlSMCMZonfOrn9UKT7IMoX5lI6qkMPe+bx/JWvs/zYri1o10UiJ/K4jVyL3z/sacbu5GWdhjnPBw0ci4/XanCGx/u5GMNt9A/M1+Yj4OX08l/gu0+QHpWNDChEqSED4E6nlue9sg/n1Fb4LKy8dCLPrrqLVKDergjpzs4Vk X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(3231355)(944501410)(52105095)(10201501046)(93006095)(93001095)(6055026)(149066)(150057)(6041310)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123562045)(201708071742011)(7699051); SRVR:HE1PR04MB1530; BCL:0; PCL:0; RULEID:; SRVR:HE1PR04MB1530; X-Forefront-PRVS: 0823A5777B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(376002)(366004)(396003)(136003)(39860400002)(189003)(199004)(316002)(305945005)(8936002)(386003)(55236004)(6636002)(6506007)(106356001)(25786009)(36756003)(16586007)(5660300001)(72206003)(52116002)(53936002)(26005)(6512007)(478600001)(54906003)(68736007)(186003)(16526019)(50226002)(7736002)(105586002)(51416003)(97736004)(76176011)(78486009)(3846002)(2906002)(66066001)(1076002)(4326008)(956004)(446003)(2616005)(47776003)(11346002)(1006002)(6116002)(486006)(14444005)(476003)(8676002)(50466002)(48376002)(81156014)(86362001)(81166006)(6486002)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR04MB1530; H:Tophie.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR04MB1530; 23:Fo9j//qseTGil3nSProbNQMTma3hPv87MAfNSlyNU?= =?us-ascii?Q?lnY/o+AJohsUwWanKQBPkS8RlyHdmnq7c9mA8v6YxKuq+jEUk1nh3zg4nV69?= =?us-ascii?Q?4DQIi/U1joCJkPqLPUo65IKzRgEa0TAG9lBw5wjZEckQF4gJ6v/P35ixgQAt?= =?us-ascii?Q?n7CjeAv9r/lbMyxeWtPqgG9ZGnhQcsx37BLWobFs4eXjXev+j2/6A9L8UMwN?= =?us-ascii?Q?TmnaasHGsXleYlHMn6FUpJx2rXE4KOgQOSwgQfxa2EQuuZJQwNq02ckOgEhS?= =?us-ascii?Q?u5bQpuYyUjHM+ErfdU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vufc99W+YB+jBdKgUtYlVmrxPdLXkXZ01L5yk/+wMyR+MXVKE7JRtbVw+lcIJWoBMttL9eCYG3LA4O7uJp49jtDcvIe0szPOdwKGjJWb2kpqV/nXthfqex9QolxoEVadr9KyHimN1R+IBve8+OrX1fDB3eNO+IzXeAe+TU4=; 7:EEet7jXrWsOzwrEfXIj01tk0CGVKNCEXTulZtf5ziOIMTmIcFifNbc6WjJ3rH0nD04/VI90bGuP7ET5QqhcDbqigWTFN8ZOxJEdMIVGhhgKlSdfbxZcYZ29v2kZVYJ0QOwgtVI42+dKf4h6rH/Cp8c0ifI1oIGMdXDSHTEQgXZNJwEFGALPWY7985Irg4eeKR+sQuZ0NgGidcAs1sW9RpkZn5KESUvNdIfkukubzNnNSSbuRmrFB7xJyo08GfJSR SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2018 14:41:53.6001 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 26d03462-7955-410d-b9f6-08d63050daed X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR04MB1530 Subject: [dpdk-dev] [PATCH v2 12/14] crypto/caam_jr: add statistics ops 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, 12 Oct 2018 14:41:56 -0000 From: Hemant Agrawal This patch adds the following statistics operations: - stats_get - stats_reset Signed-off-by: Gagandeep Singh Signed-off-by: Hemant Agrawal --- drivers/crypto/caam_jr/caam_jr.c | 54 ++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/drivers/crypto/caam_jr/caam_jr.c b/drivers/crypto/caam_jr/caam_jr.c index a4118cd11..beb54d5da 100644 --- a/drivers/crypto/caam_jr/caam_jr.c +++ b/drivers/crypto/caam_jr/caam_jr.c @@ -104,6 +104,58 @@ caam_jr_alloc_ctx(struct caam_jr_session *ses) return ctx; } +static +void caam_jr_stats_get(struct rte_cryptodev *dev, + struct rte_cryptodev_stats *stats) +{ + struct caam_jr_qp **qp = (struct caam_jr_qp **) + dev->data->queue_pairs; + int i; + + PMD_INIT_FUNC_TRACE(); + if (stats == NULL) { + CAAM_JR_ERR("Invalid stats ptr NULL"); + return; + } + for (i = 0; i < dev->data->nb_queue_pairs; i++) { + if (qp[i] == NULL) { + CAAM_JR_WARN("Uninitialised queue pair"); + continue; + } + + stats->enqueued_count += qp[i]->tx_pkts; + stats->dequeued_count += qp[i]->rx_pkts; + stats->enqueue_err_count += qp[i]->tx_errs; + stats->dequeue_err_count += qp[i]->rx_errs; + CAAM_JR_INFO("extra stats:\n\tRX Poll ERR = %" PRIu64 + "\n\tTX Ring Full = %" PRIu64, + qp[i]->rx_poll_err, + qp[i]->tx_ring_full); + } +} + +static +void caam_jr_stats_reset(struct rte_cryptodev *dev) +{ + int i; + struct caam_jr_qp **qp = (struct caam_jr_qp **) + (dev->data->queue_pairs); + + PMD_INIT_FUNC_TRACE(); + for (i = 0; i < dev->data->nb_queue_pairs; i++) { + if (qp[i] == NULL) { + CAAM_JR_WARN("Uninitialised queue pair"); + continue; + } + qp[i]->rx_pkts = 0; + qp[i]->rx_errs = 0; + qp[i]->rx_poll_err = 0; + qp[i]->tx_pkts = 0; + qp[i]->tx_errs = 0; + qp[i]->tx_ring_full = 0; + } +} + static inline int is_cipher_only(struct caam_jr_session *ses) { @@ -1716,6 +1768,8 @@ static struct rte_cryptodev_ops caam_jr_ops = { .dev_stop = caam_jr_dev_stop, .dev_close = caam_jr_dev_close, .dev_infos_get = caam_jr_dev_infos_get, + .stats_get = caam_jr_stats_get, + .stats_reset = caam_jr_stats_reset, .queue_pair_setup = caam_jr_queue_pair_setup, .queue_pair_release = caam_jr_queue_pair_release, .queue_pair_count = caam_jr_queue_pair_count, -- 2.17.1