From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0050.outbound.protection.outlook.com [104.47.0.50]) by dpdk.org (Postfix) with ESMTP id D93745F2E for ; Mon, 22 Oct 2018 16:18:02 +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=mfH6KZh5eniC4ZfCOj9f1yCvMuuvVNn9wOkKfWUgX+s=; b=dVfzvNpqp3mEXUJWtNe/uKISRTdKzsgI9fGW5Oqvdo5NbTjU7TbmB+y06IWuYk/mjbDJN24z1kaQDpEWd7J1n596eixr1lXo6U7lFCc4Mpps73+LXsYxMW07VdP7Oxijc5QwBVNUNNXTeHlFu/ULyw9fCYT5uJMiXHoh1DAr19s= Received: from HE1PR04MB1530.eurprd04.prod.outlook.com (10.164.48.20) by HE1PR04MB1372.eurprd04.prod.outlook.com (10.163.175.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 14:17:59 +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 14:17:59 +0000 From: Gagandeep Singh To: "dev@dpdk.org" , Akhil Goyal CC: Hemant Agrawal , Gagandeep Singh Thread-Topic: [PATCH v4 12/15] crypto/caam_jr: add statistics ops Thread-Index: AQHUahIJkT23Zsq5WUirktfH2qLcPg== Date: Mon, 22 Oct 2018 14:17:59 +0000 Message-ID: <20181022141657.4727-13-g.singh@nxp.com> References: <20181022133021.11264-1-g.singh@nxp.com> <20181022141657.4727-1-g.singh@nxp.com> In-Reply-To: <20181022141657.4727-1-g.singh@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BM1PR0101CA0025.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:1a::11) 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; HE1PR04MB1372; 6:kW6v3SUPJsNLedDMS/hTWfnKpwYHU6/VASVCHKsh1ZGNbElrJLArWvQL9N19iuPrj2VPjsEvT1a45A2Y9hi+EwswOlQlU3mUwZ/0KnIiZmn8UjS7S/oWdgMjxix8xnewCKsi41myqLiFspVJJba2OMHrZ7f7N87jEPjJ0x31toyTxGRKRdliFfq2G/oHR5UJiIcA1BtYPnRwRNOnLWV1g2led1cP5Am77zT/UXCZ0AhdZnct82Qi+66g7beh5SRxXogeeXan+0qrMwdxhxtKUZUNFCWKHQG7WxA3XcG0h8AsYe3Ie1oABMq+CtcqrGwuPidApFusw0Jy9b56C4Wa5b2bTJlXjjvzHP6k54TmqSydd6l5Duhvi8saJzaQca2EGonla5BreBl4txQWEvnh0M4grfeLGJbeGPRDWvwvXxRb7iI/toACqgmTXgC4RB2WTtjOQSPqJ+7ULfyjhv7hcw==; 5:pZXJV40cX1Tg69GVH5ViKwGZFuQsmSHqUt/CG9KiKBAgzOSFnoQoJN0uQHsGWhy0bknl+L4MmhJ79oJy7zGSNKeKwxihihcjlIfHhRVSGc/VgLjNYxiaZUUBoC7fOQ9xUxlsMtBiuJci783+rkiSX7+gQi05hgWAdYHtcQnngr4=; 7:MxKIo6VT2QSSABdPCAKeq0b8vsCcxY3TSC40yZ6wjCCA1oDrsnxcuKUC09LKlv0FujHH+7l653hN1aVCGrlEyXafHjSwQMCWtUo5GW/z//jr08OPBHnrFDPBFmHd0UcqoIj1mdjjIQuupPkEwoN4qGO69e0d5hrx+VvPc06cGdmGr7/mySYws3K0i8imsezxJkhyqFdajyY+B0ilHVqsZmzMK6bGXwR9ZQuSN54CLYK6ylk+GP12lGGI5+jlUcCr x-ms-office365-filtering-correlation-id: 6a39c7b4-3366-4e1b-45b2-08d638292b44 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:HE1PR04MB1372; x-ms-traffictypediagnostic: HE1PR04MB1372: 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)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:HE1PR04MB1372; BCL:0; PCL:0; RULEID:; SRVR:HE1PR04MB1372; x-forefront-prvs: 08331F819E x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(396003)(366004)(136003)(39860400002)(346002)(189003)(199004)(4326008)(52116002)(446003)(8936002)(2501003)(55236004)(486006)(2906002)(72206003)(102836004)(1076002)(6486002)(2616005)(99286004)(5660300001)(6436002)(476003)(11346002)(186003)(14454004)(81166006)(5250100002)(3846002)(8676002)(81156014)(68736007)(256004)(6116002)(97736004)(14444005)(86362001)(6636002)(105586002)(106356001)(6506007)(386003)(478600001)(305945005)(6512007)(7736002)(2900100001)(110136005)(54906003)(53936002)(71190400001)(71200400001)(25786009)(316002)(66066001)(26005)(78486010)(76176011)(36756003); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR04MB1372; 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: dnibNyvrlSIZ7Uss2a5ns5JfZSo7fku5fHskjrYU1AVZ2KCALiddjBzXeXr7OZSPucjf+rhco+HFvMZsXT83zGb9Q8p8FY4j4YBHZnUZmKSjOEwX3C4o8sF1YtXx2oi0JyoN16AfozFP0FeFUow5ZsEcWxy7R+3qmdFnNztjk8w3T67XFqyWBpJUM4ab3fZgSJXuJ7qWFd2bj2/yGob8xoMpXPsyyx6LlQ5gd0wkoyvxO+UuGlqbWxUw260ISLmbGe8FkH5nuppKp0xozjEAikelXiW7xs/8FMAwcdT6zDflX50U6k9WF2Mthgbzbf1X3xFdFOnrnLEYuqAaMRsNhSATSgot0xP0nfpHDJ7MbDs= 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: 6a39c7b4-3366-4e1b-45b2-08d638292b44 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Oct 2018 14:17:59.5747 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR04MB1372 Subject: [dpdk-dev] [PATCH v4 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 14:18:03 -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 0d3a49145..c89d76dab 100644 --- a/drivers/crypto/caam_jr/caam_jr.c +++ b/drivers/crypto/caam_jr/caam_jr.c @@ -103,6 +103,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) { @@ -1695,6 +1747,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