From patchwork Mon Oct 22 14:17:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gagandeep Singh X-Patchwork-Id: 149386 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp2690183lji; Mon, 22 Oct 2018 07:19:44 -0700 (PDT) X-Google-Smtp-Source: ACcGV62yiJwN6yQy1ACrNzwweCVB9tOUQ6tImLVZBK80M3BMMy5xY3Hvon26NWkpgFcIhKMzinzk X-Received: by 2002:adf:ae41:: with SMTP id u1-v6mr44110348wrd.43.1540217984058; Mon, 22 Oct 2018 07:19:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540217984; cv=none; d=google.com; s=arc-20160816; b=wxEgMwPzQuafIyqgLli9vRbH2G9v3gSNnYV8Ub6XnuFiMqCVnOypLzT4sI5fS+buJI p9+GGk57Dg7svOWN73NAljQv1FNuUNJ+wixsD3ofnHQMCQ4ebtViUF7rB27zKgWkhP9X wHbLiBQnYEaVLLLQ5v/uVzyCJuzIv7erE1U8FcoCWjza5/2ILDTW5wkHZ8F2OYRkkTSj p7d6GsoxVNRqO9HEH9+0sulYhNOtYlK89FJS4jGJk7XvmSFn9pCQquXzOOVT7e997Ark TqIVEi5DwaWupdDqz3pwav7/R677JZgngkWHzY6m2Ti4X70C5vKDP00+w1zwpnAuYgEn d1aw== 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=mfH6KZh5eniC4ZfCOj9f1yCvMuuvVNn9wOkKfWUgX+s=; b=sF2uHon+1LNcwqHgPY9ni4I3cK5oYCnSaeK3ucVsD2LJrJYeDvro85MqL/yGo+YNcr ERW3M7ACmJvMpYLdYVnnSfvtR2rwFXbNVZ878j2aB7H7Otb0qM9FSUsTX1OKTQhdxpgv NHs98lSB+Jfrp8lGvbxCATbgxPRnq3qBibDRGG/BO+wKVU6/JsyeQieW3oxE6kN8FRRa 9bVrzplx14Pgfud6UMiYCZgOvoP5X2iDkrppi0+j8QZHyj2313tboWeoirWRWU0/9Xu5 3Rn4HfBV+0Cz/s8de5Y/Vqt2+yWqxqvbpd74K/Ang2pR5GzFUfxgzzR2OKm8nfCYvqv8 almQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=dVfzvNpq; 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 r9-v6si27615448wro.197.2018.10.22.07.19.43; Mon, 22 Oct 2018 07:19:44 -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=dVfzvNpq; 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 AD2601B144; Mon, 22 Oct 2018 16:18:10 +0200 (CEST) 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 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: , 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 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; } +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) { @@ -1695,6 +1747,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,