From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0079.outbound.protection.outlook.com [104.47.32.79]) by dpdk.org (Postfix) with ESMTP id 721CE1B1A9 for ; Fri, 5 Jan 2018 10:40:36 +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=4iFjuCLNYOOEW/W4eI3qPHI8LefEVVj0ix2sEkYHIldYZ2NWQ5TkVdWUp3ExVVeZyMhpG6B18ZrTtdpr1OtzLvXX4v3lJvDNLriHqxjyml+Ni3yn340JozuIb0LDQuG7ENpUX9fbKBv2+37zga1gOQkTSsgBDHY6+0g1kgZjlRU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ravi1.Kumar@amd.com; Received: from wallaby-smavila.amd.com (202.56.249.162) by BN6PR12MB1508.namprd12.prod.outlook.com (10.172.24.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Fri, 5 Jan 2018 09:40:34 +0000 From: Ravi Kumar To: dev@dpdk.org Cc: pablo.de.lara.guarch@intel.com Date: Fri, 5 Jan 2018 04:39:46 -0500 Message-Id: <1515145198-97367-8-git-send-email-Ravi1.kumar@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515145198-97367-1-git-send-email-Ravi1.kumar@amd.com> References: <1512047553-118101-1-git-send-email-Ravi1.kumar@amd.com> <1515145198-97367-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: PN1PR01CA0084.INDPRD01.PROD.OUTLOOK.COM (10.174.144.152) To BN6PR12MB1508.namprd12.prod.outlook.com (10.172.24.149) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 837bf7b6-f040-4d4e-ce24-08d554205ef1 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060); SRVR:BN6PR12MB1508; X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1508; 3:CvcPSaAjQyQ6qQliTQ9Zxl/zOrRauEnXRY2yQxQqf10QKlccuqZH5++3HnbB9gr4TlUQbzuo6ZyDZnJkKaPq/o98wPvXNI6iCAKpYCj8c/MZDZf6wNru7CLuVv66760vFHjS5/zHKpXa9/7Or8wJPzd3GU1T0s4oWQ46MeulEx66AlhqyZ2k82H0rehzwTHSB+ytowWmfxEzFV6u6MWnud4p6VjQo3KesUvU9+ZsgQSLbcdJsypY3DInDyCUVLrk; 25:wBXYUPHIz4dJNxDtzoF/AVX3Uaz/eouU3BC4mtVHCuaSgzaB9n4EpKUX7LKP6keqGMHrkMQX5k31XE9lFcrgmi5m5M2GY9bnkiSKcoA65sup6aI/cwpvWDH/9o+rrI0DS13+moXa18lPksKmVG5QKmRI55kbhSETL/HNqdITVcuGmOV5ITj7rL6sUr8tnd1RLjDBSeXcx7TqOZE6dxMFBp8EkZ01hSM9b2UQkwN0dv1sUQFvCA3jYOl20KuhrZ73i/U3m54k4ng5yIkdDFgQ6PdufUSGKGD6ekW5iBs3LK8LmjZYVLWMciAyjciPunRLqsQNmhXZgd+gzZ/MqAfMCA==; 31:PaYEbcdI0M2f6l/dYKaJnrx7nHZSDXH02gLVroQlx+WhzWWSJuzyOwR1Bb00+Xmn6oUYUAfoUxpbL0WwAj4X3TwnemyNesnzYkdXFjNrZc3WW5c8YSbHjXbGqCQdJw8sFSzt/P5CWs5odC6s3wV92hL1IKdzT2tnbEkbc4CPY8jWf744qeWtToi2N+iVTGac6oOSo1Eom3eIw+PMIbroI3GW3t1p6OkPOLN0Ch2+HCg= X-MS-TrafficTypeDiagnostic: BN6PR12MB1508: X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1508; 20:eGH7SCNQ2I9BtSc/0IxTBRMJIdidALEp4EFPyPs5JGMJZCzgGnmwU0+l9y16wvWKY4VYlW1ntAvUlIzw7WqerkYti5xIf5gRcuqWy9M8VMFaqQqnqnEHOpC5ThjVcPfYlLfmq3+BMv/sE6uVO5qwMrutQOMrvGAIA3e5WnBVh+/+B+GMMO60Rpla0y+bMBWqNAdLLcIu7kdSjPgNRRjFoG0Sw9lQCzdR2WDk8U/T5EMopooz5fI9SyET0psC37i2/gSjV6JipgNxf1wqz/p0ubKB1ksNHVM1vClG8XQo/1VYiaEb4eJ4x/kB0qsWaUu7yj+3mWBy+637qEpkx86Up2E7cHkAeGEO6Q9gvI/hxe5mX19dpXuwrUdUeJmmXu8dvLvq4BnKjdqLR+6Zc9OPAuX3Jd+R1HnHDfqxUfRWrDuXQ9XuMwjRaTyyDJnLrrVtscpEauOYitmH7i28Y93ZWR5BQgBq3UYp9w5uVB4OeZV28Db6J17LkTxurBs2HO6t; 4:3ldU5W0MepQUinOyjjmAmYq0aNNECTkUM80JI/8RVuUE+z0MsTQERajw5+VHAJDk+xIii8ey+LYlVqWO4F4eQfyRcYDq6CgvGYUXzDfcR+cF3+0Hc965yJjmJrJf6rQ+zXPOfoTQ5MffPwvhF9U/swlfCMQdHn7kgg6B8vzCUdQ47QC39cMmJYmlzky0zFp1vAYTKiuWkkf50fKKB/jJjvZ+QaLH9rMep4FTDKxEzFy/+IzjolQ4W0NUmWqpIb+0FjzTL4mvC/nptNDJTvCmg/L2wg4tfHC0nzFt0v9hLg90mZVTpGTB2jhEjaPra2ms X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231023)(944501075)(6055026)(6041268)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011); SRVR:BN6PR12MB1508; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:BN6PR12MB1508; X-Forefront-PRVS: 05437568AA X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(39860400002)(366004)(346002)(39380400002)(376002)(199004)(189003)(6486002)(2361001)(6116002)(106356001)(386003)(105586002)(3846002)(6916009)(2950100002)(16586007)(6666003)(16526018)(36756003)(4326008)(2906002)(316002)(97736004)(25786009)(478600001)(86362001)(68736007)(8676002)(48376002)(51416003)(81166006)(2351001)(81156014)(52116002)(8936002)(53936002)(305945005)(50226002)(76176011)(72206003)(50466002)(53416004)(7696005)(47776003)(66066001)(59450400001)(5660300001)(7736002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR12MB1508; 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; BN6PR12MB1508; 23:lQVn6fKlvIAh2bLviMvWe1Cfyou5iE2DOw+bXXSGf?= =?us-ascii?Q?fVdVUnpfG32ZbMvn3GhlKr8mcbf4mCy2do6zLD50hLZQsPDzQAYX79/Ncvvq?= =?us-ascii?Q?amgLARHARjh6jJIeUk8kiUXM4Oy3/4znzjtiEdLYyQS+rVIk1fGQ6+8onQRk?= =?us-ascii?Q?+/V2YeoN3YzAnEPGVNtoTY9cMzjOuZsgpm4S8xt37FgcmZGjAz6uTj+1waYS?= =?us-ascii?Q?PlwY1lyL6EfKW9NgWZa8mx5o1YWV3hRdIUdKBttk2wdEp9ZbYkCa4/j7l9VI?= =?us-ascii?Q?+zl78O5+SG9MjJkaNCW+xpCb9X6tSDnbbIn6gXL3pg5CbtaUHFIO38Q8ibUu?= =?us-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7gkpkQ6HIvbDxCPiDAeO0D5edMLAtVd7vImkmMsQx6fX+3H7tIn7tX70hZXtbpdAkZnbsCMtEUFwQ5rD6G2gtVRUEV5XpKpH1z1tu7dYyPJHFPimgErFoYewCShkWlGXQOkj+0aEBi4DO9FFa+VAfFt5vGhm/BaGAvBT5K1L+fQKD6J X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jan 2018 09:40:34.2165 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 837bf7b6-f040-4d4e-ce24-08d554205ef1 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1508 Subject: [dpdk-dev] [PATCH v2 08/20] crypto/ccp: add stats related crypto pmd ops support 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, 05 Jan 2018 09:40:36 -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