From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20068.outbound.protection.outlook.com [40.107.2.68]) by dpdk.org (Postfix) with ESMTP id 553795689 for ; Thu, 13 Sep 2018 08:09:39 +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=mf2hgXfqBOHv0Vz5xEJ2Y8mdCwH3zrS0isayg5/uznM=; b=Jk9dAW8SgmvtTBZBZSluPvTNAuwAatSyXOyohOuJDFOpaAq65WG7b9cyJO9Kemps5O0+xdTo5ijJBuwHOs7Yih2n4mCSA+TVbMg1Jb0qweKuODu0JbF2ih5lyuYzbWbvG7yaXHwp4A34VcDDaWzoNTZ2+2ryxM2fwXXXUdbwLf8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=G.Singh@nxp.com; Received: from Tophie.ap.freescale.net (14.142.187.166) by HE1PR04MB1529.eurprd04.prod.outlook.com (2a01:111:e400:59a8::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.15; Thu, 13 Sep 2018 06:09:36 +0000 From: Gagandeep Singh To: dev@dpdk.org, akhil.goyal@nxp.com Cc: Hemant Agrawal , Gagandeep Singh Date: Thu, 13 Sep 2018 11:38:45 +0530 Message-Id: <20180913060846.29930-10-g.singh@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180913060846.29930-1-g.singh@nxp.com> References: <20180913060846.29930-1-g.singh@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: BM1PR01CA0095.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00::11) To HE1PR04MB1529.eurprd04.prod.outlook.com (2a01:111:e400:59a8::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d6bcb79b-1a18-428b-f08e-08d6193f7c2a X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:HE1PR04MB1529; X-Microsoft-Exchange-Diagnostics: 1; HE1PR04MB1529; 3:Lvk1v8br7sYU6MewVbMCMha6ASfmRyI5LeFFtOMLW3A9ZJ71yHBmwhUECHeiuHNGj248Lw4p0dWf8Rnm/0F1KVn4FNsORLbY+uwyURHWnqd/JanNfihrB09IEs2KfwY78OqxnPg+jCvYqN1Q80HNw4VolhZjJXg7Wdb3uUJ6NaxHRuzzMdQmC9hbmMlnBulx1kaFO7gzsRE8A2l4fs9HgO949GQoKAFxuCWP08NM/TyE39gWddytgLhNfc+1Aenk; 25:PzPH2In5KcU/ruc8fJ1HU4DGGsj1B7U8e1gLpVQeo46/IH6NWcQnvP32MCAVUdBqATa5zkgNs6mdmwunAtRJj+68LFTD4RmQcaaSeeG+VsGv6fEWOnQPY3q8hCXwyUqtCeHppUJtjY7p9hYISD9pIP/qrpQSaszu3atESOJh4QMDrD0T7nMu8TGBFhKH9Z9pyrtiriiwEYE27d2u4JdXOf6FbQ1Y5/nz62shOcWISr4RvJHDSacvd5J2h2UgM3dUB1kmfFp6qaxbbk+fKrMAqVWJkNauCNj6+PzIJHz15G9yC8UnisV9/7NgKoy+lo/YjZAzysk4QV44b9mpDschYA==; 31:tKq10tzrzAjouD/OmNrkazOEWq6iLoHxcq9ubipatcHbVxLahhaLwmsa3g4xqa7z1rXcA7StkTEbuI6I/+0EavWovqBR2Gj/BHQqF2NWqmUUpGe5GxghhEllId0phyvwsoW3a75oefz9I8bHQlUEY47bVHyhgBJxpV0RFt/s3JrYQ8ZCu85AbX8kfmtppD3BhInvnHNoYQOFqdlYcsQY84vlhsqJ3vLD4tpALN+3rlA= X-MS-TrafficTypeDiagnostic: HE1PR04MB1529: X-Microsoft-Exchange-Diagnostics: 1; HE1PR04MB1529; 20:kae4L6OXNGCAkgORjLs56vipcQf7I98koJvgi/RCYG4EvcF8C1xzXftE34++N2+VtvI7Iw3QOCFJKgTgpNgGdkICWn+FQAMgV+wOsv7C7wCCxuE9gPSKzaqQ/fsYY7q5hV7kI+1McdltufGwNYESvNhT8j4M4plpYmxlbAJGdE/Ehhoby4C6XFLfldAIx/p1U5hvWZkTUi9RmrCriVoC2CCfczu9XiefZTpjNfwo/pdZUfqyFW6rA4sSpXzCsuHYi3wGCae9oy7+E/ooOgtbH9d7Qd/EZ5q1HVJysQcw7/JPCCWzsMXIxgrLrVURmQcvRf5gmQzOvqBx19mikY2ofd7pFeF8gFID86/5VD1qP+ANIMbTN6m6O7ie3rAMiEilECcQZzup/lXtOokIYG7t8KFNFrAa2M5oCWQkz+4klYsQfhQapNgqgTsBkBO4/e4JsissUJzgorQVEYJjPp/8ysuAiWvyLFfHd+JaJ1TlL1CToxoXYzsWBCn5sTb3Q543; 4:pFDKPPAhAZvY/S3Z0Hmbrl/2m6FhCnL5nM3J6xtFxSZL+IefbvSiMP74tZlP36BUl+8SeHIQNT72pRpappi23XECZeraCZotdcl847X7Ex/KFsn6bQwE8U1NqnoStqcNVuWACZxjcIilCqTLKZOcMfdEAEM9NH4VGRt6woVfkCjdgVIIE2OGAC+TbuIXcsD0veqc1WtJjjymC+2OWTqDn5VGfYuyp0MCKJYwkKLpXMXNrf1JuRNd3IIPOyTaxzB0e2Puxny+5hORtqgt6AJoZDSjbp3ZFwR+vFVsafgCfkdPHyJZKJtzblbfb03NvbKD 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)(5005006)(8121501046)(823301075)(3231311)(944501410)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(201708071742011)(7699050); SRVR:HE1PR04MB1529; BCL:0; PCL:0; RULEID:; SRVR:HE1PR04MB1529; X-Forefront-PRVS: 07943272E1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(376002)(39860400002)(136003)(346002)(396003)(189003)(199004)(2906002)(6506007)(386003)(5009440100003)(6486002)(51416003)(6512007)(52116002)(486006)(2616005)(68736007)(956004)(53936002)(476003)(446003)(11346002)(305945005)(26005)(7736002)(55236004)(76176011)(186003)(16526019)(50226002)(478600001)(47776003)(1076002)(3846002)(6116002)(48376002)(105586002)(106356001)(25786009)(14444005)(50466002)(5660300001)(36756003)(72206003)(66066001)(316002)(97736004)(8936002)(81166006)(4326008)(8676002)(86362001)(6636002)(6666003)(54906003)(81156014)(16586007)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR04MB1529; 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; HE1PR04MB1529; 23:4TfV8SINjLDJdlXE2fG7NqCJg8KcUMHcZ7e/3fWIM?= =?us-ascii?Q?ej4JsXNoMrTQKKVteMviG20rqNG3XFFVZG7DzwyjHPIoX9HTWBijc16mioQ2?= =?us-ascii?Q?0tHonA2V+IiDH64UXFhCWQpMaDFFriwcNnKHHLD200A03dpB4nZAMtKhYiOt?= =?us-ascii?Q?hJNcSlFKO5JK7+Q6ShxRk1UsZtm8b6FEgOd5PYrr0OzXNIQC5encX5lWkf/P?= =?us-ascii?Q?fn74kTb50o6CrK/qX81aquDLlzYD52gWETfSk3JS0Fat7zWDi5F1G9nyrJDi?= =?us-ascii?Q?9H9KnI7oHHILETh/dfM65pFyQLyit2NSX+g3qhc0l4usr7Z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akwfbV/wLlc9A==; 5:+0su8s2CmtbWULVsiQ0KSSdqrkCSLjDpStbJWQ/CSwNhBGQO3ovgFwJR718WES2sWraECpigGKzhnIVhvugmA7yf6LP9G6/Gbq4I+SwC7V48TwntixtuUZeud3WwWxEQpzdiZZl375yg44khiT6xHkheUAyMVTDcgjo1yryxOlQ=; 7:FlUDJiQQTZvkc2/qSLwMKVSngP+rjPZvPZ1jFkaDB+VNFWaxFbg1+VHM7gqQBldP4LPwbfqAozQXxrXIkjmnBW3nQhLSzBkdBh5koTpNqU+xSRjV4ZQ+24woQNZrvOKV9oIqxMvzbqpf9Ma47cPLGfkcbSGQ8V6r11XhVFshD4pWVvSHHv9qcvWZYnb+0nicorPkVHv9gKZVoc3RKQC5VgcRb0U5Hz23cx/XN5XcRgWWcg4cGT5c29TTEiTQnNP1 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2018 06:09:36.4451 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d6bcb79b-1a18-428b-f08e-08d6193f7c2a X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR04MB1529 Subject: [dpdk-dev] [PATCH 09/10] crypto/caam_jr: add stats 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: Thu, 13 Sep 2018 06:09:40 -0000 From: Hemant Agrawal Signed-off-by: Gagandeep Singh Signed-off-by: Hemant Agrawal --- drivers/crypto/caam_jr/caam_jr.c | 55 ++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/drivers/crypto/caam_jr/caam_jr.c b/drivers/crypto/caam_jr/caam_jr.c index d582b2fcb..f51ff1093 100644 --- a/drivers/crypto/caam_jr/caam_jr.c +++ b/drivers/crypto/caam_jr/caam_jr.c @@ -99,6 +99,59 @@ 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) { return ((ses->cipher_alg != RTE_CRYPTO_CIPHER_NULL) && @@ -1689,6 +1742,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