From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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: , X-List-Received-Date: Mon, 22 Oct 2018 13:31:29 -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 Acked-by: Akhil Goyal --- 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 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; } =20 +static +void caam_jr_stats_get(struct rte_cryptodev *dev, + struct rte_cryptodev_stats *stats) +{ + struct caam_jr_qp **qp =3D (struct caam_jr_qp **) + dev->data->queue_pairs; + int i; + + PMD_INIT_FUNC_TRACE(); + if (stats =3D=3D NULL) { + CAAM_JR_ERR("Invalid stats ptr NULL"); + return; + } + for (i =3D 0; i < dev->data->nb_queue_pairs; i++) { + if (qp[i] =3D=3D NULL) { + CAAM_JR_WARN("Uninitialised queue pair"); + continue; + } + + stats->enqueued_count +=3D qp[i]->tx_pkts; + stats->dequeued_count +=3D qp[i]->rx_pkts; + stats->enqueue_err_count +=3D qp[i]->tx_errs; + stats->dequeue_err_count +=3D qp[i]->rx_errs; + CAAM_JR_INFO("extra stats:\n\tRX Poll ERR =3D %" PRIu64 + "\n\tTX Ring Full =3D %" 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 =3D (struct caam_jr_qp **) + (dev->data->queue_pairs); + + PMD_INIT_FUNC_TRACE(); + for (i =3D 0; i < dev->data->nb_queue_pairs; i++) { + if (qp[i] =3D=3D NULL) { + CAAM_JR_WARN("Uninitialised queue pair"); + continue; + } + qp[i]->rx_pkts =3D 0; + qp[i]->rx_errs =3D 0; + qp[i]->rx_poll_err =3D 0; + qp[i]->tx_pkts =3D 0; + qp[i]->tx_errs =3D 0; + qp[i]->tx_ring_full =3D 0; + } +} + static inline int is_cipher_only(struct caam_jr_session *ses) { @@ -1716,6 +1768,8 @@ static struct rte_cryptodev_ops caam_jr_ops =3D { .dev_stop =3D caam_jr_dev_stop, .dev_close =3D caam_jr_dev_close, .dev_infos_get =3D caam_jr_dev_infos_get, + .stats_get =3D caam_jr_stats_get, + .stats_reset =3D caam_jr_stats_reset, .queue_pair_setup =3D caam_jr_queue_pair_setup, .queue_pair_release =3D caam_jr_queue_pair_release, .queue_pair_count =3D caam_jr_queue_pair_count, --=20 2.17.1