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 A0F66A0C41; Thu, 15 Jul 2021 18:43:37 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7411241342; Thu, 15 Jul 2021 18:42:35 +0200 (CEST) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07on2060.outbound.protection.outlook.com [40.107.212.60]) by mails.dpdk.org (Postfix) with ESMTP id 7BF504132E for ; Thu, 15 Jul 2021 18:42:26 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Kmqupppju3S0vZHUUGNZvRs/z8TpmwubSoMI88lOhR7alVcJjoiGVuPQDlfKbsZ83vcEe8Lk41x24ar2NUH5OrqdRHfpUDecixQaPO4SyuiMf+skVk7uXcnvQ3gdI6vvKncAa8BlTHcG8+tIr2VfUE5dHw8qqICB03dspVOvoTxILAyf1/NBIBEylHnjhAIWhdLpnEBuzxYV3WCix2AnIwgQ2JTy07cqI5kAHboWWXJsRgpjWLPuv1qjCugxdckjdZPU+eJiRBq3ZRHCuCz/ewN2ShpyFJa1eei6ZIXA/PJ7w7gqqn6lazy0jDvulkmIaTVv9yphXMHNVGXnepwZVQ== 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=O4FKGyEgXo8qFfGP+OwbZJw4gj+n/d1dtPMorv2nKq336re61FA5lS3hT74ZzgG2+0aBrJuJpox9TAcAMEaDSZYNNvXF1vyY1wnVT+VlmhOkxQyoRpZFzRa3S3QVzL6906PYZDpyuSB6/whoatFPsmhMTo4oUBhu+pEGtbzuw0fr2gImxmeillwehW1nh3walRbQMcZp4yUBIwxy08/ACrZpFjwjAWsoub7arnZIxyQQCXkXFuiOywK0fDZIxEJw5XuFockpV2yasUi3naAtviW0C+nAugtNtHuovqtIhXnQoY9rns+bIxVYpM7hdgpCZnQkuBnpAKbh4U6GnpgfUQ== 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=J3MYdzZz72NZXRNUpwKW+QGtfzcFRb5ko2Nv7rlwXrnbgNcvB7Z4qctH1ZvZ16H4iyQxbJRUwH/VoBcFj+dyvoxUT0eq0K7oFYG7umoIOxCtReCEKmx7ZCcv5UATtxUb0cML2czjIfZEKmbf8Ypzfdt1TwGdIYcFaRfxM6gJpHWdLQRoN5OdUtrSEhgQ8AsQ1rqW2YeTPuy0Dl0lB12vrs2W9YLKLYRvydDRgS0LyGXTY6mV2b+AHiGlHSUXBAWjaZOdPGL/4JoIm6jgzA3i3imSHV3LCfaWDp1X547ljTeLx1IdgR6mfzJNLuJyv6DseS9XbYUPgJj49y8BDpzKhQ== Received: from MW4PR04CA0333.namprd04.prod.outlook.com (2603:10b6:303:8a::8) by DM6PR12MB4794.namprd12.prod.outlook.com (2603:10b6:5:163::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.23; Thu, 15 Jul 2021 16:42:25 +0000 Received: from CO1NAM11FT037.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8a:cafe::e6) by MW4PR04CA0333.outlook.office365.com (2603:10b6:303:8a::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.24 via Frontend Transport; Thu, 15 Jul 2021 16:42: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 CO1NAM11FT037.mail.protection.outlook.com (10.13.174.91) 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 16:42:24 +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 16:42:21 +0000 From: Shiri Kuzin To: CC: , , , Date: Thu, 15 Jul 2021 19:41:23 +0300 Message-ID: <20210715164126.54073-14-shirik@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210715164126.54073-1-shirik@nvidia.com> References: <20210715150817.51485-1-shirik@nvidia.com> <20210715164126.54073-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: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b4b027a2-0586-4e3b-a4e5-08d947af8679 X-MS-TrafficTypeDiagnostic: DM6PR12MB4794: 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: gjb0BfkydR3woqE/Q82Ad/Wf/i1N5kF01RFnaAzOqh7fThPUHWzNqeANI4SUATXlLUiYptTs7OiUewYVtww8sCO9T1/kFEKRZ2nx48eUi/v7YaCH2B0oZ3g3nL/Kj2eAnKNIoiqDJ0a0sUL4E+NT8t29wM/nwMxXMZq1QoYHvY5oGRc4qcHJBB7kNf9+8MoLEp/37/r/nIIgxM60foXSkOfTlDH6V5KQGXkbraaUQm2DwNwPG8XMDDCSs/YmyQGWIsntE/RWNdNfVjcuQH+L27nezN8y0Av59iy6Uv5PNWKUdGKW4FI66XP9IAGXryy6/8SQE46671EyUc/L2Jgai+egBC851cY52dE6Wkl0es6SXaCpoQv7umNeBQabJ/e2sJlXSi6tZlbCHJCfp5NtNngkpZVijNxvjf90/Ygzr2JRD2vuWGuH4b4565d9PlUcoApya7eTsoAD2CFbsPtTQZgjsSTwtlXyVrGKr6nw0FfypEhNFoFP3QLoE7lsfnjoO0lnzr8/4SOX6pZIJYy0LhpDO2q+OxlKVqv3AJ781PVbxFyce99o0dcUaoTQ+JFoeMP9Mz16gQDZrZcXuOfADB0eSJToGPI/14hgixYzhxsoqIRR74uS1BTFvC6NumFmrjgDN6EGP/fXFI8d8Yjqlj6cu4ocdWlAhMtgYWoTH0z1wVxy4acA2HxpRgJSP1t1MK0MN7fDaK77sgWWhFKLaeYUMbfTGNk2QChaavTsZlg= 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)(39860400002)(376002)(396003)(346002)(136003)(46966006)(36840700001)(83380400001)(36860700001)(82740400003)(1076003)(70206006)(6916009)(6286002)(7696005)(5660300002)(426003)(8676002)(316002)(34020700004)(36906005)(36756003)(82310400003)(2906002)(478600001)(54906003)(47076005)(55016002)(86362001)(16526019)(26005)(8936002)(7636003)(186003)(336012)(2616005)(4326008)(70586007)(356005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jul 2021 16:42:24.9574 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b4b027a2-0586-4e3b-a4e5-08d947af8679 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: CO1NAM11FT037.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4794 Subject: [dpdk-dev] [PATCH v8 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