From patchwork Fri Oct 12 14:40:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gagandeep Singh X-Patchwork-Id: 148781 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp820220lji; Fri, 12 Oct 2018 07:43:39 -0700 (PDT) X-Google-Smtp-Source: ACcGV60mrIQaaYU9+fJSY1XrdTpL9lrzGz3804Ks34/CfHxl2LiVlyJwHifMgs/OahvyatFN+xU8 X-Received: by 2002:adf:9f0f:: with SMTP id l15-v6mr5630674wrf.206.1539355419232; Fri, 12 Oct 2018 07:43:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539355419; cv=none; d=google.com; s=arc-20160816; b=ONugTDwY42zeRLPG5D5ersku6T/mTFyHkARWq4NMbIb0isd8uIvQx1lHXPgQWkhU3u 1jvppKMtlmt/E9fL2NhN/m+ZxdvKtp51chFtvqzW1Z4ixkGgImFqK3i4viAQq7f298Ul zJMV+KoaksGA83El1iKGpTk8VuMIASUBcH5FRmsegALYGUExSGVj5Z1hUBaWNq7BrrWN VyL7fTkW7MuJZxL5Qz7wMO8q2z7bnvsG6kT34ngipT1WGUvPILKsuSgrpln5OIASjly+ zMaY1Af89kxm76q3lxBjn/JgTOpPvzBtiU6jAJbuakLN/MvZoZofulCDIdXaDjtBJ0zO 7diw== 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:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:dkim-signature; bh=oSP3fQmcKZAfWVkNQdSs+HGpeZfipb6O19rI5ne/7RM=; b=xGHmHwXRm0mzeqoLo5FkTKIUDIdNUdvV51wTndS2TZHegMkO+Ko8g1AkGVy/tQUmAh iDuTL04THqAEnR1pEtZtNsdDLzN2/3SYAxyGeXP+vOsDw9bhG0yjpaoJ0b26ThJM1V6O 6+/XvtLLmu8og7NAfIPYXg5TshKJgvl05lLuR+tE1ItgrqRU7nLjWCnh/AwQVuK8zoNJ 41GpkzUYra7iN74cjoa4PWJlJI4XSfsThlB/ZpeKJDNDAPrrED0F2RXCyILNofr2RdGA KSPlWstGh5I+LLMnWqlObPDmskjz6Dg+/TlTmVkk0C+y+wgfiBtcjhBtwaOapwxkgj6C 8T0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=MQjFUgd3; 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 o70-v6si1284126wme.97.2018.10.12.07.43.38; Fri, 12 Oct 2018 07:43:39 -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=MQjFUgd3; 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 B4EE51B9BF; Fri, 12 Oct 2018 16:42:04 +0200 (CEST) Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50047.outbound.protection.outlook.com [40.107.5.47]) by dpdk.org (Postfix) with ESMTP id 68F8E1B959 for ; Fri, 12 Oct 2018 16:41:56 +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=oSP3fQmcKZAfWVkNQdSs+HGpeZfipb6O19rI5ne/7RM=; b=MQjFUgd3d15e9JRi2FdK1g8bjEu97H68zsZcpgHiXwGBMjJp3ToW3HHLPmol/9gKRTaOUQJdWPnvPFS+ZSw+D8TlHWcxk7j+DAcw6hwMu9QZT20ylc6UJjT0GiNRS3q6jntnYyigdxLyIN/hB/Yp32/i/07IeCBVwtPplCMEB8w= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=G.Singh@nxp.com; Received: from Tophie.ap.freescale.net (14.142.187.166) by HE1PR04MB1530.eurprd04.prod.outlook.com (2a01:111:e400:59a8::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.23; Fri, 12 Oct 2018 14:41:53 +0000 From: Gagandeep Singh To: dev@dpdk.org, akhil.goyal@nxp.com Cc: Hemant Agrawal , Gagandeep Singh Date: Fri, 12 Oct 2018 20:10:53 +0530 Message-Id: <20181012144055.9461-13-g.singh@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181012144055.9461-1-g.singh@nxp.com> References: <20180913060846.29930-1-g.singh@nxp.com> <20181012144055.9461-1-g.singh@nxp.com> MIME-Version: 1.0 X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: PN1PR0101CA0039.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:c::25) To HE1PR04MB1530.eurprd04.prod.outlook.com (2a01:111:e400:59a8::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 26d03462-7955-410d-b9f6-08d63050daed 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:HE1PR04MB1530; X-Microsoft-Exchange-Diagnostics: 1; HE1PR04MB1530; 3:qcHsjhrpQU6l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4gB5oXFNsTpMt8tImMnIaI+1Kpj1A9IU9A4eSE918C82XmvHsLKQnqZM8/35jfumvHjelfwdX+cBmkwux049FlXGt8IwdSwSLv2GF425c7erM996IvGqKfyCz3f3GQ5GYYd+3PelY1jIhHzesRmYzioiuUPNPWoXt7M5LyHkeNc1FLPLOYgjzsvAA9FM0R2KzJHC6yxxcQcmnkOiRBx0bH98OsGJ4lPDyKRqofeTP08grBrt42n9UMmO+/De9OidB6Rc4nVsabxFP9w2BXwV268LY7fjxqcPf3Bql2viPfjfqtXBwHU30BbXU2vMaUU6mcVoq/HTxMv62OZnI; 4:vxFKPbLdJw0VMHTz7gpT47cyfqHYrQ6zuCKSbWCfleSCFS9wsAnWXTMjYg8Ilcsa3Ue7IFXVoc81Of5chWvth1H2nbvSiymbjBaiSKzmCWaU1OY+2Kbg8DlTwohWywf7nEdupfunWDGyA7roAYWoLQtaudlSMCMZonfOrn9UKT7IMoX5lI6qkMPe+bx/JWvs/zYri1o10UiJ/K4jVyL3z/sacbu5GWdhjnPBw0ci4/XanCGx/u5GMNt9A/M1+Yj4OX08l/gu0+QHpWNDChEqSED4E6nlue9sg/n1Fb4LKy8dCLPrrqLVKDergjpzs4Vk 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)(149066)(150057)(6041310)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123562045)(201708071742011)(7699051); SRVR:HE1PR04MB1530; BCL:0; PCL:0; RULEID:; SRVR:HE1PR04MB1530; X-Forefront-PRVS: 0823A5777B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(376002)(366004)(396003)(136003)(39860400002)(189003)(199004)(316002)(305945005)(8936002)(386003)(55236004)(6636002)(6506007)(106356001)(25786009)(36756003)(16586007)(5660300001)(72206003)(52116002)(53936002)(26005)(6512007)(478600001)(54906003)(68736007)(186003)(16526019)(50226002)(7736002)(105586002)(51416003)(97736004)(76176011)(78486009)(3846002)(2906002)(66066001)(1076002)(4326008)(956004)(446003)(2616005)(47776003)(11346002)(1006002)(6116002)(486006)(14444005)(476003)(8676002)(50466002)(48376002)(81156014)(86362001)(81166006)(6486002)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR04MB1530; 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; HE1PR04MB1530; 23:Fo9j//qseTGil3nSProbNQMTma3hPv87MAfNSlyNU?= lnY/o+AJohsUwWanKQBPkS8RlyHdmnq7c9mA8v6YxKuq+jEUk1nh3zg4nV694DQIi/U1joCJkPqLPUo65IKzRgEa0TAG9lBw5wjZEckQF4gJ6v/P35ixgQAtn7CjeAv9r/lbMyxeWtPqgG9ZGnhQcsx37BLWobFs4eXjXev+j2/6A9L8UMwNTmnaasHGsXleYlHMn6FUpJx2rXE4KOgQOSwgQfxa2EQuuZJQwNq02ckOgEhSu5bQpuYyUjHM+ErfdUOTTyeiO7n8luk0rkIuaieT4QxYG6mIA1ty4xSsBJFg6jJMtDP/E6Ted16V/NymWRI1EoricDinBYIKgIoUJngtqrFV4mCjz8dmFlGlD70imwSFJbwDCmrSE9vuDdqccwfbeSAhSzEHolYvq73KxrRHF20nF4pm2jzNSmlB/452TOE1G8u0K/jB+8sZxpNESH8ZVd+bd2AGEEAlPcNbc0dnUG61X0krPvrBYh5weAA8XyxxFAPhkXrY9A1xDpg3VHEpYf580toOhFydKV64mhWffyj/GV1gblw/50EN9mPmH+vS4q28nPK2ztr4A6d+KhewfK9xszeMNNfh9+OKlx3uWwzt+P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: 1; HE1PR04MB1530; 6:/5LdAP/1gWQziHeB3Bs4Ktz9FCDPBqNLFNJ6PW+XBMSG5JnJ6Ug3p1ceaFRqYhBqOowrZ9jpqvbi71wact5TTO0ANXAfkFIhIK4XkQ1pz+LPDcADyPm3809eRNfq6hMfYrrkK2RZTHSGFL0KTOEg+ef4e7EG3xVcYtSqtjauGtrpIg4jn1U/FNXBYJ3HhWYyFVracNE4btb9o3ekhl7WEDgfqgtTQIXEgkKggWG5dpgv0fbAi11wVXyXhZkA+1VOH1pv98bHlAB8vUa/VfsZRt6QDoBbINLFErwB8uhrlnfzeE3NSWjha9tz8IgERlVr0f+dd4OK50CsEgzR1nKT87vd2N3goOm4xcCqJe8KmpxBPtUJ6bFAS90TQYolAPbXUWe6NwXGA4safw7UR04kP7h8YBhdyfTbtWiXCiE0Xmr7VsBbUjmW3mD6lNRezRaoQXUqohhrVD89qzO17Pe09Q==; 5:R5DDvufc99W+YB+jBdKgUtYlVmrxPdLXkXZ01L5yk/+wMyR+MXVKE7JRtbVw+lcIJWoBMttL9eCYG3LA4O7uJp49jtDcvIe0szPOdwKGjJWb2kpqV/nXthfqex9QolxoEVadr9KyHimN1R+IBve8+OrX1fDB3eNO+IzXeAe+TU4=; 7:EEet7jXrWsOzwrEfXIj01tk0CGVKNCEXTulZtf5ziOIMTmIcFifNbc6WjJ3rH0nD04/VI90bGuP7ET5QqhcDbqigWTFN8ZOxJEdMIVGhhgKlSdfbxZcYZ29v2kZVYJ0QOwgtVI42+dKf4h6rH/Cp8c0ifI1oIGMdXDSHTEQgXZNJwEFGALPWY7985Irg4eeKR+sQuZ0NgGidcAs1sW9RpkZn5KESUvNdIfkukubzNnNSSbuRmrFB7xJyo08GfJSR SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2018 14:41:53.6001 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 26d03462-7955-410d-b9f6-08d63050daed X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR04MB1530 Subject: [dpdk-dev] [PATCH v2 12/14] 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 --- 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 a4118cd11..beb54d5da 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,