From patchwork Mon Oct 22 13:31:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gagandeep Singh X-Patchwork-Id: 149381 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp2637201lji; Mon, 22 Oct 2018 06:33:27 -0700 (PDT) X-Google-Smtp-Source: ACcGV63VbQb8ongXe0KusZTvohpEEuzDAdBEnzSFR0fmk65i7206D4JAyUsjvWXbZj+Q61oje08U X-Received: by 2002:a1c:f53:: with SMTP id 80-v6mr15321461wmp.58.1540215207006; Mon, 22 Oct 2018 06:33:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540215207; cv=none; d=google.com; s=arc-20160816; b=qSZSs1dlNXJeALiHRHXetsdce54mrKmIHLFSKx/A3s5ZPz5u6/KWw6M4a5nlmxkLQh Rf9gTPIMbMVd+CIeSwx4fZLRvbIA9dnqwUIHfrlrHmY+ly9rAp6KG/Ls3ZzgnAMi9PPZ k0bDav4BAtPgEFnskfcOrcVnM8fFJ59cysR21UzRWGnamnhoKGySUXl2nBWvG0NuI6Vp /wySu6QoPK7S9dVaE13yjfxVWf0lPGgVc2LKYdkFr/IuC8TfsppEXlyjpg8iorfv3p/f deiRP/zm7b/MsyUMgV0rElxCyj1K8p8BXlaen9arx0YBr/Yw1hxnD+kjKP9gAqziEHgI xsQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:mime-version :content-transfer-encoding:spamdiagnosticmetadata :spamdiagnosticoutput:content-language:accept-language:in-reply-to :references:message-id:date:thread-index:thread-topic:cc:to:from :dkim-signature; bh=hbkaiqAEnTk1YGLSt+vZiLGga00x3EjK+ajitfQOtpI=; b=WVBJXFCFX2mp3lnyuR6GA4qeRaEL1eKyYPSv28MZ7vs2fYsPajI/b4QYv1dvVuvXxo gKlOHQDf/gBtsphj3Cz/ocbeyRIjaXNS7P2jYumskuGsnDh72/UB3u2cl7WBA5uxV6CN In5y33aMuU3Nn0nEap9vTed1MtHJ4Rx9ASM7k11AObad2/V+EhESXqok46dRaL1TXpKL XMc81Ihy0LbzWhb/cAUSoyKeuVntaFJULGMd3yE8A56bP52qKT/AkxtA25mbCOhXOvWk cZdnpL3+iry6DVARo3HOCfjJNuiNJFfFH6N2cg0qdmwDhSb7YgtwaWjvnGVgc/um0P6J RB1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b="qR/hk3SW"; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id w69-v6si9622971wmf.34.2018.10.22.06.33.26; Mon, 22 Oct 2018 06:33:26 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b="qR/hk3SW"; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EE5D37CBC; Mon, 22 Oct 2018 15:31:35 +0200 (CEST) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10064.outbound.protection.outlook.com [40.107.1.64]) by dpdk.org (Postfix) with ESMTP id 93AF24CA5 for ; Mon, 22 Oct 2018 15:31:28 +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=hbkaiqAEnTk1YGLSt+vZiLGga00x3EjK+ajitfQOtpI=; b=qR/hk3SWy/wQDt/ljqK6cUXW2vw0xJ/hirTmVG3yoGDupW2+LALudgPqFK0PXKpexiSS8TVdlUQ6ZaQGPTfI9sSh5JeAeIA2pRNizhLCD4UNwrlylAudivzE0UzzLAMxKIhiqNF6vg1JO3XbTw9QwK120q/kI34CRRP+TPwLjvc= Received: from HE1PR04MB1530.eurprd04.prod.outlook.com (10.164.48.20) by HE1PR04MB3131.eurprd04.prod.outlook.com (10.171.196.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1250.30; Mon, 22 Oct 2018 13:31:27 +0000 Received: from HE1PR04MB1530.eurprd04.prod.outlook.com ([fe80::95cd:198:d5c5:59a4]) by HE1PR04MB1530.eurprd04.prod.outlook.com ([fe80::95cd:198:d5c5:59a4%5]) with mapi id 15.20.1250.028; Mon, 22 Oct 2018 13:31:27 +0000 From: Gagandeep Singh To: "dev@dpdk.org" , Akhil Goyal CC: Hemant Agrawal , Gagandeep Singh Thread-Topic: [PATCH v3 12/15] crypto/caam_jr: add statistics ops Thread-Index: AQHUaguIfnoayL0c3k6jFVxE1QQwPA== Date: Mon, 22 Oct 2018 13:31:26 +0000 Message-ID: <20181022133021.11264-13-g.singh@nxp.com> References: <20181012144055.9461-1-g.singh@nxp.com> <20181022133021.11264-1-g.singh@nxp.com> In-Reply-To: <20181022133021.11264-1-g.singh@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BM1PR0101CA0016.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::26) To HE1PR04MB1530.eurprd04.prod.outlook.com (2a01:111:e400:59a8::20) authentication-results: spf=none (sender IP is ) smtp.mailfrom=G.Singh@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [14.142.187.166] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; HE1PR04MB3131; 6:4jBZe2Mey5Vmoan0wFzcbsHnooSibIf5ZOamjxMFdZEd82j/z3lma9sbNLmKK2PmjWly6++AVov/vyw7zk/3FhDzbAu0wjX8CD4LCmmHz943FzT7AJ0HcO/th+JGPUpuY9FrzuCkGvAyBLf/oFw3vWR7SmRSNNDAiXVKmdgT/ftVsegqct4EPkEyrUhJx9cBK4F4eCpJXH1w9FaiQjnWnltNG/i5XqKSr18vxueIkCrlLD2on7MjZVrJ40HkHLMGHEug2+yKeXN57RtBOoQeAWuLsycJq/8Z6U13Kq1Ch97kY+/WTSVg/Ri/72oJowNq9tihhMz42EdhzFgD20DO4faxNs+IucRe1QmbCYAka3WIEHJDQ0gUuPS8aG71ellpSiXNgryR1I9w+jc2/j/zRGkzUrzKzXEDTkbaabINE/DvUCBuh4WTrwP2YJt08i3U0OKc4WiObREEZqQxqMgJPw==; 5:BKbNeQy2CNI4Vg8QVoNrvKa/15FU2SjvsGbewuiW2R96DE68Fa2AshNJjVO+W9jF8H/LSw/B34Z0dz8kNJhBVho3SZ9C98c12/BVMdQcugafKVnzXi7eAYB0xFFv2Yz+Bd2+OqM8yJPSmycEITJoQycdLFMDBI3PI/EybTluKqc=; 7:7h6JkWdHT5U1R/56lpuP/CNmA8USajPIXp6NAro7VjHeUqs2qFX2C8rXTBdOTrkX/8gsTFpSOlM5hNqNq4AsFgYTWUjmfawnAZejZx1OrQLG2FsdvNg0yv2+dMVGUrgIkW83HNcNsoJYrOjGERdB51NRRICOHM+wtd8wYFMImSiDVWD9SsmNkgWNLee9RgqoJgLANeT5ZWy2KY4/AuKIFFuBYGSPy5ytYJVHkH99hpcPdqQs8v1MasHCNbJTH9XC x-ms-office365-filtering-correlation-id: d9617979-38a8-467f-dd97-08d63822aac6 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:HE1PR04MB3131; x-ms-traffictypediagnostic: HE1PR04MB3131: 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)(93006095)(93001095)(10201501046)(3002001)(3231355)(944501410)(52105095)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:HE1PR04MB3131; BCL:0; PCL:0; RULEID:; SRVR:HE1PR04MB3131; x-forefront-prvs: 08331F819E x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(39860400002)(136003)(346002)(396003)(189003)(199004)(110136005)(99286004)(316002)(54906003)(81156014)(14454004)(25786009)(72206003)(81166006)(2900100001)(8936002)(106356001)(8676002)(6116002)(3846002)(86362001)(2616005)(476003)(6506007)(386003)(102836004)(1076002)(11346002)(446003)(26005)(186003)(305945005)(478600001)(4326008)(2906002)(76176011)(68736007)(7736002)(6636002)(97736004)(486006)(52116002)(36756003)(55236004)(105586002)(71190400001)(5660300001)(6436002)(6486002)(78486010)(53936002)(14444005)(2501003)(256004)(66066001)(71200400001)(5250100002)(6512007); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR04MB3131; H:HE1PR04MB1530.eurprd04.prod.outlook.com; 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-antispam-message-info: F+reXyEwjiUVEFTWg3MgpqnOouohzlW3r7mBxwI9nON1BZjE1xb3xIl39yCzCHQJFtYkwLSVaZi9MjQR12Lo6+02HyELMTI7w87zT+EJG4Iyp/j+0jOtwbtiugUGqwSrNEyTsffCO566Phi9Nf6k7lxZpcG+nE8uQRKsNpg2qWijkSE1y0aWzttlovkO1Nt4plSGmKzXinxwXfw0+Qh91AONqYdPKGtI+aGvyDctu2UJNbHLZaZlKg1CU8WbSgVSMBFMMd8Jmr/xWAmbwt++8UmRk1r93BP2dcojBkwNOtN6voUem1CmQH1X7pSpPkZdJiuepCtlFn1ySEeNqbrvt1KCwIAqk9OdUjmEVpho9nk= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d9617979-38a8-467f-dd97-08d63822aac6 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Oct 2018 13:31:26.9791 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR04MB3131 Subject: [dpdk-dev] [PATCH v3 12/15] 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Hemant Agrawal This patch adds the following statistics operations: - stats_get - stats_reset Signed-off-by: Gagandeep Singh Signed-off-by: Hemant Agrawal Acked-by: Akhil Goyal --- drivers/crypto/caam_jr/caam_jr.c | 54 ++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) -- 2.17.1 diff --git a/drivers/crypto/caam_jr/caam_jr.c b/drivers/crypto/caam_jr/caam_jr.c index e62ce6186..e12c8715c 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,