From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AE746A0547; Thu, 29 Apr 2021 17:49:13 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6B1F141351; Thu, 29 Apr 2021 17:49:01 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2040.outbound.protection.outlook.com [40.107.223.40]) by mails.dpdk.org (Postfix) with ESMTP id 65D5D41362 for ; Thu, 29 Apr 2021 17:49:00 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l8KP8EudVsCEvzTsrDeGY0NyNktjIF6iAkEO5cQJOCiTVz3RGC3+XIUqngcCkXPfDadlRh7iWcPLOa5LWwPJknbtSLO4F7zvZkPwvG+gd1Udcn9Tkf5guA/4HBRVTyyiyGlSoNIgGPuGENct5YYukL2T4/b+suBTA3JCIOXqyFfdH3/i5bDDl4gfI5T2QMlMJvMpJJQBDC57fO3cOlLS2OMp9IR/AV5J414ATCtrTYiuwStOs7rz6eDykECeJ9qd5apyhHYoFxYmUJ817Sd7oM5AM1KNiL4Xx32RVU17hdsXn00bSP9g0IZdNSt3GAHbZmDB4XSSf1xWLQziSbeL2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Y0gJ8n4hTsOfiF5ObuvDVtsnhKZzfC5fe0jVpKGGWiY=; b=U/fF/Gn+b3/tNRc4ryTWnIKUNTNe7SWv4hVzzdZDX6y+y68DmRKX6jyxNiedE0y54lQBkhgzO+1Tku2XL/T0/tSGpD/xwuXBWuj+QIWdB1gx+00XOV2meRwCljXxK8CDxUm263f1gTXVtqneiDa9Bqk0DfV/EAzHtjx1ik8e95m7cXetEAntN4uvRjdwZIdIrl+8kCAIGo36QVSfNWyzn/SqaLDodysIT268DMhGDZHIPzTB9ub/k9Xq99p6HusgM0B1ebjqgulf2F9OsWzSccXGTXxT11ZBDslzjXTw2+V8tUUWuX+B+qwoj41+N8ejNQUt/pSzukQ534UE214UbA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=marvell.com smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Y0gJ8n4hTsOfiF5ObuvDVtsnhKZzfC5fe0jVpKGGWiY=; b=kkgGywI12gXHnczwArydBMSynvRk0cN0o2vvBP4MgzgI3hSaL8UUbtA6pHUqUWFtnb/BZl8PrOZBxwycuraWNmzIfZZ3yYbbGowm60qI0i9sdbjKnUIylRNkW7Ehu8jYr9A+oJxmosB7qrZDgwvzZW2swIBQG2Z6DvcOmF2jfRXNeotfJuuuYoxuuWRgQ8rXAMRmDbm/NqUNjI1ETDbjlCNxavuKcVLwDbWEW6FeBoM24/LWl7SsJ+qGaTFTfBupaXIwVK/1q5pEHM0PM7p1g9VXHEGQOudgx5wkA9Er96PSBKTRrX9G86TYtiBT6mjsqUv1V4Z/VsmS9yrtsSniuQ== Received: from MW4PR03CA0275.namprd03.prod.outlook.com (2603:10b6:303:b5::10) by DM6PR12MB3450.namprd12.prod.outlook.com (2603:10b6:5:116::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.22; Thu, 29 Apr 2021 15:48:59 +0000 Received: from CO1NAM11FT053.eop-nam11.prod.protection.outlook.com (2603:10b6:303:b5:cafe::73) by MW4PR03CA0275.outlook.office365.com (2603:10b6:303:b5::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.27 via Frontend Transport; Thu, 29 Apr 2021 15:48:59 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; marvell.com; dkim=none (message not signed) header.d=none;marvell.com; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by CO1NAM11FT053.mail.protection.outlook.com (10.13.175.63) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4087.27 via Frontend Transport; Thu, 29 Apr 2021 15:48:58 +0000 Received: from nvidia.com (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 29 Apr 2021 15:48:57 +0000 From: Matan Azrad To: CC: , , Date: Thu, 29 Apr 2021 18:47:11 +0300 Message-ID: <20210429154712.2820159-15-matan@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210429154712.2820159-1-matan@nvidia.com> References: <20210408204849.9543-1-shirik@nvidia.com> <20210429154712.2820159-1-matan@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.145.6] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 05fa8ba0-2465-4991-6204-08d90b264d99 X-MS-TrafficTypeDiagnostic: DM6PR12MB3450: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:158; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CHRtDzzzHGg+m6FAh9w4jh+Sb7ILMPPyuDDiPLz0yi0B/pd9fw3HIVguaGPggUOpLWs6ACujVFQQl/G9qJFPbampx9womyWnYDFL8Xm/v6fj8ZCdDFx7nM4YvAGpJCXn4qVGYoIknq6K2CXbV68PlA/sGh83u8E1mh8GY8v9coGXqZOxLSUuLJV/VKjmgdAbeSJoto1OGzVKiupDb3wwT4k+ULrk5jUDMVD5j47UayMt0A9VPzJRda3cE4VY2tIYYpi8eyxKrlELmNPyuSeB+NodHUCOunNJ4L4IZUnw3BrFlp7AFOxD0HPVG2VWmNkGxoPv6HvqeZGZ2k/WPwJN/3+ndnk9dJIrdKFZhO7wDcjS99yS+k3oX4TlHecXKfoWd5Q2MMFJaENF/OlXKRBp5946ZHBtu6nYpM8BKG6Q5cHtu9nfIgTTrx/EJ15x5Up23mYqKtgwh7SuTl3MoPNTGlK7vNXYiZ2OSYtVOqoEV+YL52k6q58mrOOG4NNysOOtUpUMAdVAFDzODfZFpc/DgertPVKjkTICPbjdczg9iRsxD1v1l3/svHUMtDMWj0jpvnhOmMjelfZmNYUbuiYroqYwufetUDW+MCKeki/m2DbTdEs6nbT3U6dWSyck97aRc/rmg5jjM5vQmjl7FBVLNw== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(346002)(39860400002)(376002)(396003)(136003)(46966006)(36840700001)(4326008)(36906005)(316002)(54906003)(6286002)(6666004)(5660300002)(55016002)(86362001)(16526019)(356005)(70586007)(70206006)(2906002)(7696005)(26005)(186003)(478600001)(82310400003)(36860700001)(47076005)(8676002)(107886003)(6916009)(1076003)(336012)(7636003)(82740400003)(426003)(8936002)(2616005)(36756003)(83380400001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Apr 2021 15:48:58.7127 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 05fa8ba0-2465-4991-6204-08d90b264d99 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT053.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3450 Subject: [dpdk-dev] [PATCH v2 14/15] crypto/mlx5: add statistic get and reset operations X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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: Suanming Mou This commit adds mlx5 crypto statistic get and reset operations. Signed-off-by: Suanming Mou Signed-off-by: Matan Azrad --- drivers/crypto/mlx5/mlx5_crypto.c | 39 ++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/mlx5/mlx5_crypto.c b/drivers/crypto/mlx5/mlx5_crypto.c index 08a8c1e925..af8985939e 100644 --- a/drivers/crypto/mlx5/mlx5_crypto.c +++ b/drivers/crypto/mlx5/mlx5_crypto.c @@ -437,11 +437,14 @@ mlx5_crypto_enqueue_burst(void *queue_pair, struct rte_crypto_op **ops, do { op = *ops++; umr = RTE_PTR_ADD(qp->umem_buf, priv->wqe_set_size * qp->pi); - if (unlikely(mlx5_crypto_wqe_set(priv, qp, op, umr) == 0)) + if (unlikely(mlx5_crypto_wqe_set(priv, qp, op, umr) == 0)) { + qp->stats.enqueue_err_count++; break; + } qp->ops[qp->pi] = op; qp->pi = (qp->pi + 1) & mask; } while (--remain); + qp->stats.enqueued_count += nb_ops; rte_io_wmb(); qp->db_rec[MLX5_SND_DBR] = rte_cpu_to_be_32(qp->db_pi); rte_wmb(); @@ -458,6 +461,7 @@ mlx5_crypto_cqe_err_handle(struct mlx5_crypto_qp *qp, struct rte_crypto_op *op) &qp->cq_obj.cqes[idx]; op->status = RTE_CRYPTO_OP_STATUS_ERROR; + qp->stats.dequeue_err_count++; DRV_LOG(ERR, "CQE ERR:%x.\n", rte_be_to_cpu_32(cqe->syndrome)); } @@ -497,6 +501,7 @@ mlx5_crypto_dequeue_burst(void *queue_pair, struct rte_crypto_op **ops, if (likely(i != 0)) { rte_io_wmb(); qp->cq_obj.db_rec[0] = rte_cpu_to_be_32(qp->ci); + qp->stats.dequeued_count += i; } return i; } @@ -655,14 +660,42 @@ mlx5_crypto_queue_pair_setup(struct rte_cryptodev *dev, uint16_t qp_id, return -1; } +static void +mlx5_crypto_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 mlx5_crypto_qp *qp = dev->data->queue_pairs[qp_id]; + + stats->enqueued_count += qp->stats.enqueued_count; + stats->dequeued_count += qp->stats.dequeued_count; + stats->enqueue_err_count += qp->stats.enqueue_err_count; + stats->dequeue_err_count += qp->stats.dequeue_err_count; + } +} + +static void +mlx5_crypto_stats_reset(struct rte_cryptodev *dev) +{ + int qp_id; + + for (qp_id = 0; qp_id < dev->data->nb_queue_pairs; qp_id++) { + struct mlx5_crypto_qp *qp = dev->data->queue_pairs[qp_id]; + + memset(&qp->stats, 0, sizeof(qp->stats)); + } +} + static struct rte_cryptodev_ops mlx5_crypto_ops = { .dev_configure = mlx5_crypto_dev_configure, .dev_start = mlx5_crypto_dev_start, .dev_stop = mlx5_crypto_dev_stop, .dev_close = mlx5_crypto_dev_close, .dev_infos_get = mlx5_crypto_dev_infos_get, - .stats_get = NULL, - .stats_reset = NULL, + .stats_get = mlx5_crypto_stats_get, + .stats_reset = mlx5_crypto_stats_reset, .queue_pair_setup = mlx5_crypto_queue_pair_setup, .queue_pair_release = mlx5_crypto_queue_pair_release, .sym_session_get_size = mlx5_crypto_sym_session_get_size, -- 2.25.1