From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0059.outbound.protection.outlook.com [104.47.37.59]) by dpdk.org (Postfix) with ESMTP id 460801B22A for ; Wed, 10 Jan 2018 10:43:34 +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=IB8mToa5SRtWcq5Z4ATxjRGPFknEBeZyolLSE6MtMMb/U7eyZDOINFyepX4vIw+K0LUqwll3PBicpiVX3gMmOg5CgKxhTAhlQRQJLLtq9djJyb0CggLs8dmO2e8Wza17UGCf4mufuTnIRfwR5yA00Ohc+BZQpfTMYTlLOs5Zg5o= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ravi1.Kumar@amd.com; Received: from wallaby-smavila.amd.com (202.56.249.162) by CY4PR12MB1509.namprd12.prod.outlook.com (10.172.68.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Wed, 10 Jan 2018 09:43:31 +0000 From: Ravi Kumar To: dev@dpdk.org Cc: pablo.de.lara.guarch@intel.com Date: Wed, 10 Jan 2018 04:42:48 -0500 Message-Id: <1515577379-18453-8-git-send-email-Ravi1.kumar@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515577379-18453-1-git-send-email-Ravi1.kumar@amd.com> References: <1515145198-97367-1-git-send-email-Ravi1.kumar@amd.com> <1515577379-18453-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: MAXPR0101CA0024.INDPRD01.PROD.OUTLOOK.COM (10.174.62.34) To CY4PR12MB1509.namprd12.prod.outlook.com (10.172.68.22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: e4895d55-7236-49cd-d9b9-08d5580e9ce0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020049)(4652020)(48565401081)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:CY4PR12MB1509; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1509; 3:bHOJDMdowBQ4f9aUpYg7iOqG8pfxEzmzNN2FTjDuHhxoHxqv12ndqITFNfJXOV4Ap1ft6xDMfWayPNCdkZo897CwgvhJsWgq1zCBoBzblMVmLnAN/RV8ITm4hDWSIbuSAsai3HJzJ0NRy/sxvhgfIQE1Qe9S6r7u2TfaIWVrxzrILseW8Ow+/OEJ3bAvvYc9jIZj3JiOUO9PVr+O/+kYQjrs5vrIB1C3LxrscaCX22HAYdrwn1rpklIhyjlbfnWn; 25:b32WThXag7kpgy/morZwLDc2gdRF7BDGvYBCVKUsG9sQi/vN7+G2xSf1RAbHflSwwVUMHkMd9bv4OxHasPbkMmcFhlnttIyRcEpVw2A+UJGwg2wVvopgpcVlt/TZORJrFFEhen+F03vdBLoWGouXLXAJKp2Waf8RpIsjZeevQ/EjFPwv8DDqfUpgVZCm1ajAlP83gFHWH98tTLo3JUm2cJdN5pTjbl7EK047/ocHBdLQJK82aUi8i5u3zEuTl77GIph71QfqTqBPK/UHySMchVEbDwE3lgpQtmXGTLKOxVKoE8GMAuJ87BatJdx3FGWuZogVNxPwnFgoG+rywunb0A==; 31:bRqn0Pc5gm0Jbx5l6ueckLBwl6g9FGQ3sheg4G6Yq/r14dMCfQytCbh2jRBITT5ATHnLheDidw5a7EN21ECCVtaM552z/r/jCmbIvtlwCnNXt55UA2kEpqVnvgptl+1ZacDL///Td+hf3mL8Uw88S1+5AgTqqJ79q5En2PHjZfGJoswllAWdf/lcwH+IIpruUO/BJFDvge7u32Y9Y+VicbNpANs1L3ZYoiC2OClZRII= X-MS-TrafficTypeDiagnostic: CY4PR12MB1509: X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1509; 20:ghupGURslfVhFctLjWmza+2TZNwR6UrBxRnJdWpKXTcQxaPoOZTB+H/JJ80ldUdj1/+lnzpcOD51vUVCF751w2FJj2lUePow88kI1O2dhlQsgN/wSMNzTaYf0GV3MaMO68au+9JsfveWCNJpgzoP/XNJT5LABSsPS8dlxKDX8BG5XFj4YMZCK3AQgibI5NbZHbciJXy9LK5Ygu1FRGEdLnUG9RsZk0ei9FxLZbjvzfsVtqddIMj3ZfGDLqcl9eKOFDFjoFKWz24Q6IUqSb/zC5iaPZlAnIngNh2UeOZdRwexUvoPuq5n/1AOURZke3RSlDhmpTehWDY7DmTg39M+Kv5bJxza0yJ8cDguHQIAnpFWXIPk+zQnRqSyjfBPk9YumIcdY9S7JQZUONUyaLo9D3AGukv4y7Ry33yDkJ3i1tBp35GLLVrM+T2duDAHiIWPRd5XgHsTwLeGnQn95V3ff3NJNb4pGBN4rRfsEKPO9KAm5R9tp7ALy6XK07AUfiEE; 4:6VMzhBdZZpD977XsNnllF5kRW20t3SqH8JoYOlwdsOf4RjfWAqW8BKnCCUcCSuEUwq3cPRzTSPvBIJCLusKJ9YpRm1YPocu/NH6Un8XDs9owEV6yLrzbvRpN4nbQ8od5KN7wYwd7b2sog2OtA8I3h77sZGNJGwMJ4SfHbzKsO3Niw16a0kabtrQT/dGjb53mHYtZdxcypwRSPY1Iqtbmpj5CJ3Uob23+t6Rn0cT6WnxFD+b+esXi4W3Y3CeCtLyYQQUj+h33YBgiwJ7YqlXdBo3TfdB40EqLZ4SyBUmYHzUMKo3CSv3G2NdOU/XJYrx3 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(3231023)(944501119)(6055026)(6041268)(20161123562045)(20161123558120)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:CY4PR12MB1509; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CY4PR12MB1509; X-Forefront-PRVS: 0548586081 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(39860400002)(396003)(346002)(376002)(39380400002)(189003)(199004)(25786009)(8676002)(81166006)(47776003)(48376002)(6666003)(2950100002)(81156014)(6916009)(66066001)(50226002)(68736007)(36756003)(8936002)(16586007)(72206003)(50466002)(16526018)(316002)(53936002)(478600001)(5660300001)(86362001)(4326008)(386003)(2361001)(2351001)(6486002)(53416004)(97736004)(51416003)(76176011)(106356001)(105586002)(7736002)(6116002)(3846002)(2906002)(59450400001)(305945005)(7696005)(52116002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR12MB1509; H:wallaby-smavila.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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; CY4PR12MB1509; 23:tnLK//V9mGv7DU3jeDBGQmvDLlsy8FBQdVgqoHOIV?= =?us-ascii?Q?kwoa4HDpINt+X/YeGyoeWnqMXj/xGS+82tnJT5bfAmeguWusW3SfXWkUYi6e?= =?us-ascii?Q?7LQ2YhbaAAbn/iiQFYBasAL3F9rfw4ygsuZ6vCgoXPmoPJHZbXJiRCJUW0vm?= =?us-ascii?Q?HAJP4sC+U2JuoAjS+6CgLf4ZdytIwygMG7whom29eyWE3LR60E1C6ea/LX5w?= =?us-ascii?Q?kok+dBffEXH+vq8+PZD1zVckpNSV7j1ZI0YrES9JEWWj2/M/Qaluhz8VBohm?= =?us-ascii?Q?pdastpDnU/NxtXCat+qUTcdrX8qeA7pMr4dVQSyCOmL2OkzO4z5tEHuL8sSL?= =?us-ascii?Q?ddEkZABj0okOQJ8O/ss325rwlWOJ34Hnq/J6kRuj6c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Ch++aLu6vXVvqLYvlpXig58UWLIz2UX9rsL5tlA/DYyU6OQ+feukDCAGSMkw8BuzUBEciTY+a1Ji4YIrMzGqxVeWmMk1I0dJSipSZ X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2018 09:43:31.8342 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e4895d55-7236-49cd-d9b9-08d5580e9ce0 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1509 Subject: [dpdk-dev] [PATCH v3 08/19] 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: Wed, 10 Jan 2018 09:43:34 -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