From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0060.outbound.protection.outlook.com [104.47.34.60]) by dpdk.org (Postfix) with ESMTP id 1BD3EAA99 for ; Fri, 9 Mar 2018 09:35:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=ol2HhygLmzSLtDZpChhh/jGYH9fRkv6l/l7TN/jkJZg=; b=dHsWb08GVK+DuXQ780G2OYhmRgNkvgCn0iqSRzdFixPTbymvPscFPSQnVheDarQK9eBMaAQDimoLoGQJnPccRH2r8znewv1kbOsfOp0Km0u8XRBvDqtYZFBngzQywcO+0hxJjoOUExzAIVJm5apZz3mhiYo/d0WmXPY7hVFzGqQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ravi1.Kumar@amd.com; Received: from wallaby-smavila.amd.com (202.56.249.162) by MWHPR12MB1518.namprd12.prod.outlook.com (2603:10b6:301:b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.548.14; Fri, 9 Mar 2018 08:35:52 +0000 From: Ravi Kumar To: dev@dpdk.org Cc: pablo.de.lara.guarch@intel.com Date: Fri, 9 Mar 2018 03:35:08 -0500 Message-Id: <1520584520-130522-8-git-send-email-Ravi1.kumar@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520584520-130522-1-git-send-email-Ravi1.kumar@amd.com> References: <1515577379-18453-1-git-send-email-Ravi1.kumar@amd.com> <1520584520-130522-1-git-send-email-Ravi1.kumar@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [202.56.249.162] X-ClientProxiedBy: MA1PR0101CA0050.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:20::12) To MWHPR12MB1518.namprd12.prod.outlook.com (2603:10b6:301:b::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: f8b902e4-8671-4b1c-9205-08d58598c502 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:MWHPR12MB1518; X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1518; 3:QbOFk68ArjPNIM3vATI6PTO8QdPGSv5zAyw1ecpQ1mMeL9SofmCKh2H626f8NChL1RZENhdSuJTw3NILGp33UkvKmLzgh4pFSC7UEaaofx4vheQgYrGI4dP+jNrRu67roygF+7fuVNaGk6Y2cUmPmZxEWbxGxoocWjr7fUYisFVLuBEM9Ho8eDg09HWWx+rx9t/b4Ur4G6h0uWFZOQD4xHSPJbJO8WweJKPqu8dt/kYRTWj0mwr4uOSxSwM7DHdZ; 25:LmqC6Byy6KV/UG/kqQfOiBMYDsaqM5JMItPy0KAmwEHTnYp8rJwrgOlO8RVPqxz8vMFQQYcjVhi+R/xCI0oDklUiDfSZkuvYyjhHMoZGR5RWXOKHDNoFxqDj2vGifbUweyi6NWmZyv3DeO17rMYC5JDpKywEOLqmtKxME9cQ0Q2F8uZhNOkvvlj26QhqGQTboJ3pf3vABgfpFwX7+YbdC6otxEhii9qraNj40aau/V0al4+sP4ykIUeduHyYZOZ/ZwRbILXjQ2NGgqCE2nab7h+Yzmic35kVPNBVAcE1txzxc6oUUOWG6uGLNKuzJE8t2AUOir9N934nAnes61mIiw==; 31:J5AL1sI1PpFQB+F2U3So6U+zdoH8pcWiw+BeL2dt5/OT2d8JE5S+ClkJLWKTT0UDhzalkzzMCtV7jLy6lWi7zkz+quJREl9ZmoyBOVPXldZLdjkYUEldNnLTJnYR5ADnH2KvBrbQ+d59efNNPbXDNH9ZAhU8ysqF7B9yGTLI1xUo5HiQUYh7hw61qoDG9zgc8OhcDnHENLhsLxbdYUVgtUjKzCEwI0371Z0L4fFBDeM= X-MS-TrafficTypeDiagnostic: MWHPR12MB1518: X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1518; 20:T6m5sXfXVbAIxSK3qeMGYZVhwxEPd9ubyjnLoYnxlwFjrXLOEFWYnCmat4h0X63EOaO7dTT/MFYtda1R19vcua0QI27+HWE78ssmIKEP6UuJHjMvkk8AJ1QFYFRC8xGUQeMClNMoEgi0G1w8e9qckoqXhr1X0lU3Z5ZN5nNiH3icTaAoeVe2emUTtL4ms1Tt8AoYlrYG2+cvNPXObOD9KVPcSBON1u4uB4aFQfvLT7I2n6q7hM6T34T5qwQuIxNFHcVAONb/gWUvk3r/u3XDURF9TWoy10RJ/sjBQs3Hp3AI7Y4ZKUqDDGqQdThbhVgtNKGaIuoxDfleKQd7otB4LwVm6ITLECF8B/C+8fJmmaRIQ0p5HL9GXv+0s43b8OtBLcJMOGlHCx2MLmZFmLglB+DHuj47Hz8GFA69tFvkCHEViWLahErBOBrcn6u2lLR46VB5qZCn1FO8e0nP/ungxzhTtPV/Kst13paEElIInREtFTEGL+YzwswuBrF5DRff; 4:dWcOajHWrIdYDSQWi5X8W1JoXT/uoUvQgsNMoS1evsZYeHtjh+bM7QDgoJ8rlMCKsGq+2HCr8ydjEZeowa+0TVYYPxAPbWjEluwQbHhgw243rDg2minvAWy8QTHKM12pWxohxYjf8AmIZ37m6Dz61VMTBbcTTOzmRAarUPOXaNPltS0n/Uog3nvl0c9O1EXZXqSSL1j6/tcdjm1gbLZRzAmvU3O6lroBrBPWa8dewsqrjhZAXFzyLvou6CePUgkI8qo7b2DCDF75d3vqMzr4vQmvGcx4B+3AaR9dMUrvMpbmcHPsp6fUBgctkGaCRnx6 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(3231220)(944501244)(52105095)(10201501046)(93006095)(93001095)(6055026)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:MWHPR12MB1518; BCL:0; PCL:0; RULEID:; SRVR:MWHPR12MB1518; X-Forefront-PRVS: 0606BBEB39 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(39380400002)(396003)(366004)(376002)(346002)(199004)(189003)(16586007)(26005)(81156014)(16526019)(8676002)(186003)(81166006)(25786009)(7736002)(3846002)(386003)(305945005)(4326008)(6116002)(6666003)(316002)(86362001)(76176011)(52116002)(8936002)(51416003)(50226002)(5660300001)(2906002)(2950100002)(6916009)(59450400001)(7696005)(36756003)(106356001)(105586002)(6486002)(68736007)(48376002)(97736004)(53416004)(2361001)(2351001)(53936002)(50466002)(478600001)(47776003)(66066001)(72206003); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR12MB1518; H:wallaby-smavila.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR12MB1518; 23:AaZrN8j/imRpHhhyt8th6usWQheVghmRsgCkzYUAC?= =?us-ascii?Q?VDmzEPyu4nRDFgWChM384yC5Ct1iRK60ZaVRVpzRA1/Vo2k/PYcB00MKgsTV?= =?us-ascii?Q?pZp3otEkKfMp2KBoCimso5uKGgPqWV+WDwDpti2/uAmFW8TbnIGDy45XWxR4?= =?us-ascii?Q?zkBEhSi6YY4zdMAVK3z4MF93XSB16qMimzLRIny0QEV00aKHECly394W23j0?= =?us-ascii?Q?VHB6EMpQJPVoC20lX5eR6i+X5pht5ouOn45Mp+Tg2lHShHuu/q4q4upYzb/O?= =?us-ascii?Q?gUWba6rHYrJVvIcgJgg/elRz4ObYslOsSkJ3HF7Qbdsr7w5h+i4oO9cEh+/W?= =?us-ascii?Q?FQ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337pGgcBcKInkPCzsy5of5yQK8Xg9dtAqVlFn/sn/uaPybXwfqY06JxyIan74IcvKFpLYDfkSXC SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1518; 20:T9Iav4X0baakEpVq3t5OPvDnj7QvE84cF0O847zAXFgSCed8Rdo+ehWQlnEXB7GPGd6/IcNZneE5xVy53fyI97oOEYzwnSw90azUPw7wD5gjqH9Snz69r0DlwmKqxK7dLbUld1ARAZ6eJcg8YwRMi8qgTh35vd76EV8AMdG3P/v60VkVzgqB1OsS/RDcFBC/vTe/cmtskcDF57EwESb+lYKWV60oW630GyBqhbHJlZNFdhLbs7KdeZXLpPrZLY/3 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2018 08:35:52.1315 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f8b902e4-8671-4b1c-9205-08d58598c502 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1518 Subject: [dpdk-dev] [PATCH v4 08/20] crypto/ccp: support stats related crypto pmd 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: Fri, 09 Mar 2018 08:35:55 -0000 Signed-off-by: Ravi Kumar --- drivers/crypto/ccp/ccp_pmd_ops.c | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/ccp/ccp_pmd_ops.c b/drivers/crypto/ccp/ccp_pmd_ops.c index a02aa6f..d483a74 100644 --- a/drivers/crypto/ccp/ccp_pmd_ops.c +++ b/drivers/crypto/ccp/ccp_pmd_ops.c @@ -68,6 +68,36 @@ ccp_pmd_close(struct rte_cryptodev *dev __rte_unused) } static void +ccp_pmd_stats_get(struct rte_cryptodev *dev, + struct rte_cryptodev_stats *stats) +{ + int qp_id; + + for (qp_id = 0; qp_id < dev->data->nb_queue_pairs; qp_id++) { + struct ccp_qp *qp = dev->data->queue_pairs[qp_id]; + + stats->enqueued_count += qp->qp_stats.enqueued_count; + stats->dequeued_count += qp->qp_stats.dequeued_count; + + stats->enqueue_err_count += qp->qp_stats.enqueue_err_count; + stats->dequeue_err_count += qp->qp_stats.dequeue_err_count; + } + +} + +static void +ccp_pmd_stats_reset(struct rte_cryptodev *dev) +{ + int qp_id; + + for (qp_id = 0; qp_id < dev->data->nb_queue_pairs; qp_id++) { + struct ccp_qp *qp = dev->data->queue_pairs[qp_id]; + + memset(&qp->qp_stats, 0, sizeof(qp->qp_stats)); + } +} + +static void ccp_pmd_info_get(struct rte_cryptodev *dev, struct rte_cryptodev_info *dev_info) { @@ -281,8 +311,8 @@ struct rte_cryptodev_ops ccp_ops = { .dev_stop = ccp_pmd_stop, .dev_close = ccp_pmd_close, - .stats_get = NULL, - .stats_reset = NULL, + .stats_get = ccp_pmd_stats_get, + .stats_reset = ccp_pmd_stats_reset, .dev_infos_get = ccp_pmd_info_get, -- 2.7.4