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 79189A0A0C; Thu, 15 Jul 2021 17:10:53 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8214841331; Thu, 15 Jul 2021 17:09:36 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2070.outbound.protection.outlook.com [40.107.94.70]) by mails.dpdk.org (Postfix) with ESMTP id B3B3241300 for ; Thu, 15 Jul 2021 17:09:26 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=esKEcHeXmZob0+aGrxjj7a1qQ+3PlE/hXrqfib3WlT1ICRdnEMwhywYCg8B8QyzpSK3aqTf8YhMMa/98CFTbDe84QLxnOE41erR7ywY0VsTer+SvYP3SJJjl99hkeXK1bdLJFQk8hEwW3HEM7AMSvRQxmgxE4TCDFWrp6dDMJB+QdChHM6N24ZzJCKO4UXST+0rc4yTyvwWzJlSiPbNcCXkcrBFzYkNAT1HEjRK40PoTc13FbgTlUo875Q/4MGnBhceEm0qaHZ7a0owQiBd2P4D10+fh3+LLOBz5GOZATFInJDdQKjAcTcxgfHqd6YY0gGRS3txj2lC7EEm3rvqOZw== 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=6B4z6RaT1FojXWmhe4rY3B30tW43xUwN3dCZ8+rmvOY=; b=GGAXDB1ou2HvMb/O600Qcp+i5K+93mv4T9AMR7I6zv5wn5T9xYri2l/vE8UmEcIbrmAjp9DAJdCMnt39fmNcp/hfsiff980nrv81wVMnIJDaKVByWL3YMb1205hHiEUkILHz6x9IOLYuzINs20E9uMBQPHMifQEf53Hl3E1ItFWU5YSXtSndJ/Y4ysykFyex9kG5ziUea7mJEK/kMMCTaHdT3T8ffC8mIGq6At20E1s90YHciakg/2FkBEAZRN5f5vjxTSKVhQy0HjMHDSQ/3zvZ1W6FDSbPN443mQA87fy/c/Qcj74OfDn+vkWYRZe2MCVAm87j1PKTkctE6IbeWw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine 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=6B4z6RaT1FojXWmhe4rY3B30tW43xUwN3dCZ8+rmvOY=; b=as7eUUQ7dnZIBE93WWMeI3F+l8G5/jm0hvvDtepAaBUM1ikMCCJO8HwXdasFL7jBCJZ+ORqQjNv+FNh9N+w1qLycpKH0UDpn/lZsg8w6IRJ3QQX2Fj9VrzRytiPUdoBpIBV06a8JvQ7JDUythH9O/4QJxBOYeleiMu3YX7R+IxRjWlAROIi0UhnAxQoFBsnuC+g5/Xgo59TYjC7KxuyNzuZs34suRpRFEvY19QPJ9NrBJhN458ZBzb2yt6xgG8zgKZDlBQ+5fXnYQs1RyGSWHmsn3+ABnVWY7vS9dC9JAcSlnNdrrtWR0dni46EI/uzbfToHA7DbGZCIAdYA6reTVA== Received: from MW4PR04CA0065.namprd04.prod.outlook.com (2603:10b6:303:6b::10) by DM4PR12MB5327.namprd12.prod.outlook.com (2603:10b6:5:39e::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.21; Thu, 15 Jul 2021 15:09:25 +0000 Received: from CO1NAM11FT015.eop-nam11.prod.protection.outlook.com (2603:10b6:303:6b:cafe::d0) by MW4PR04CA0065.outlook.office365.com (2603:10b6:303:6b::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.21 via Frontend Transport; Thu, 15 Jul 2021 15:09:25 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.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 CO1NAM11FT015.mail.protection.outlook.com (10.13.175.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4331.21 via Frontend Transport; Thu, 15 Jul 2021 15:09:25 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 15 Jul 2021 15:09:22 +0000 From: Shiri Kuzin To: CC: , , , Date: Thu, 15 Jul 2021 18:08:14 +0300 Message-ID: <20210715150817.51485-14-shirik@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210715150817.51485-1-shirik@nvidia.com> References: <20210708152530.25835-1-shirik@nvidia.com> <20210715150817.51485-1-shirik@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4a780d38-ee86-4084-94ba-08d947a288ac X-MS-TrafficTypeDiagnostic: DM4PR12MB5327: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:158; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SgvZ3OFRCWmJQPI1AcW3NuuN6jRsT3V52ZUzFMpODF81pySnfTZF8O6Y0GxXvjejMhQOjveJXxUu5YsVQeeePNiEBn/l5LZqKYbbNeHP8//IoQ7M/QYKsa1aN89EFYQZYNOpwANlQ7o3O9HkdlsfwZhzNvkqU8t7XY78DFxpiTJ+3q2EVUqGDU8U3QaDaNHEoOLSxUAbCcoBbF+NfGsaZCRFVlUtajt+CsR/KTBo1DBP3iefRbgz9HbYK5VELz3zALrzXvHLW/+vCMdGleuXXcYL5k40g0Kc6vnQj+17jHcxLMMVuUMX8dsZzW/s4zT/fB9EZpW58RqduWjTWly75fYEGOSFiAKVq17EbFlB0IZLKmMm+4aZ7CIhZm3LraQUX7Ly4l2T/RaTCwGeyiuw5sziOVZ6wVVZ506F4sUl7pQKlreoQ/36FUiwq48CJSJb/LO/CPq/Xruce0p0mW899UZqufXcSuClLGFNWZOF4pF5vlHW6LZbguSSU7YDjuP1P1gjnCbMkHMXjoI4sCy4BmNOjlz0q54gTHFen+qD4H1u2kTWpDW38rmVCJk1g0XifEfFkzRZG2/TstruCX2lNh3Lblk7PeHiQ7soh/yfeywVYZTuaBMdgVTEOaLthyHP4GaLE4XTFzsQw/8RBkjtnJvRKAZWygIWgygZXr7H4Km2MuHqwq1TTvXQw0PngDJVorUxBU+bC8xJ6H1b3vo0pCPXt+cj7QqSdAAMYLzDUqI= 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)(376002)(396003)(136003)(39850400004)(46966006)(36840700001)(4326008)(316002)(82740400003)(186003)(36756003)(6286002)(8936002)(16526019)(36906005)(70206006)(26005)(70586007)(478600001)(54906003)(2616005)(2906002)(1076003)(356005)(36860700001)(34020700004)(47076005)(336012)(82310400003)(7636003)(6916009)(8676002)(426003)(86362001)(55016002)(7696005)(6666004)(5660300002)(83380400001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jul 2021 15:09:25.1942 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4a780d38-ee86-4084-94ba-08d947a288ac 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: CO1NAM11FT015.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5327 Subject: [dpdk-dev] [PATCH v7 13/16] 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 | 40 ++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/mlx5/mlx5_crypto.c b/drivers/crypto/mlx5/mlx5_crypto.c index b467739a3c..0ecca32cce 100644 --- a/drivers/crypto/mlx5/mlx5_crypto.c +++ b/drivers/crypto/mlx5/mlx5_crypto.c @@ -508,13 +508,17 @@ mlx5_crypto_enqueue_burst(void *queue_pair, struct rte_crypto_op **ops, 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 (remain != nb_ops) + qp->stats.enqueue_err_count++; + if (remain != nb_ops) { + qp->stats.enqueued_count -= remain; break; + } return 0; } 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(); @@ -531,6 +535,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)); } @@ -570,6 +575,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; } @@ -731,14 +737,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.27.0