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 C7BFD42C6F; Fri, 9 Jun 2023 17:29:24 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5B7184302E; Fri, 9 Jun 2023 17:29:20 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) by mails.dpdk.org (Postfix) with ESMTP id BFB8242D8F for ; Fri, 9 Jun 2023 17:29:17 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=THL5Vbuxt0N7To7yjdbDPOHRn19yX6pjCbjcYZye0+KuMlKGXJfCIUiN/QnGDgyxxwmVsWoOjWWYOO4WYPIHbSsJdZ2MRMM/t3iGcfLOcuj59qkG1zbmsJYSRz6oFdbllnzAgUupS6JfKsQVAfTgQ+NmQo7bM91H5jhF70NuN8CWbT+Go31OzNPVSx88I7E89T8wsQihfFyTCRzrpT6PHXTLB0Ol1JhQYvyjZVzPAK8sEqhxkqZ5JGjJFi9s4VjzttdePF+DJREEjgOeU09jNEfOEODKKukACih2MzppICfSbpUNvb4dtIMZKp3XfZ+vPqVzKD41+dLP2aGqaChmIg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=KkiRht1cQyEH0p3tHocnTu0n32/D32DfJu4k0Rs4m+s=; b=U3iM2SC62d4EPekZGIsYjqwsOvH5+fZjVvwPe064EEUs1Vk+ielLqBHaOykfRIgXeiudk1V/FBNNW3frbwXgbguWic11iDQFhn8UOfuKPsDEc7VRYKwW7sjva6S0X5YgFH2xAVo//Haz9IHJGgT4rxUa0T+1kvVPCQppUsjoICyEJC6zKiXCblQ9q0jJWKX/BBW/Hj1U+5ixiRVlexSvj4Byn8ZVVOEcHqZpCTX/sMEGrBg6kK4QvjL1xvWEgXKFOR7bAUDqV4SHdf7sW8HET7mtaN5syNEDRL6/kW6j6amlzp0+GbBNSvj4GiXZICq7T2oiOVVeKtu4Biwh02Vq4w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject 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=KkiRht1cQyEH0p3tHocnTu0n32/D32DfJu4k0Rs4m+s=; b=PX/YDmZfXFpLzVyIVcP5M3LhpuPkRnP0wObJ2BJ9gHa3dKt+SSCAPbOK6/sWi2a9x8N8yFORsYVIIIBoPVRgU8sXkYMLL1tWSvmyr/WytPQ59mt6YD7GPqkAcbkrhoyQJsKAfKvHczRx6gta9RZfMYcAOWQgD+4gQroaqGfg/iyifHaEZEzVxBfSx6sQU8pTYuzJkRpMBZWodwNX0nK2nynb4n1CE+vy4GemGpLIDv+O1uAIIK2AMfluJ58BpilTlz+gX5OE0cborwlAsqtpfVgR6y8Ob+4IeGRXD1BUkQDf9dZxvuzFlGu1C7Ro2S99OnqNMxPl4CtPI5RWYHi3cg== Received: from DS7PR06CA0023.namprd06.prod.outlook.com (2603:10b6:8:2a::14) by PH7PR12MB5618.namprd12.prod.outlook.com (2603:10b6:510:134::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.33; Fri, 9 Jun 2023 15:29:16 +0000 Received: from DM6NAM11FT014.eop-nam11.prod.protection.outlook.com (2603:10b6:8:2a:cafe::2c) by DS7PR06CA0023.outlook.office365.com (2603:10b6:8:2a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6477.26 via Frontend Transport; Fri, 9 Jun 2023 15:29:15 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by DM6NAM11FT014.mail.protection.outlook.com (10.13.173.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6477.29 via Frontend Transport; Fri, 9 Jun 2023 15:29:15 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Fri, 9 Jun 2023 08:29:07 -0700 Received: from nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Fri, 9 Jun 2023 08:29:06 -0700 From: Viacheslav Ovsiienko To: Subject: [PATCH 2/5] common/mlx5: introduce tracepoints for mlx5 drivers Date: Fri, 9 Jun 2023 18:28:44 +0300 Message-ID: <20230609152847.32496-3-viacheslavo@nvidia.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20230609152847.32496-1-viacheslavo@nvidia.com> References: <20230420100803.494-1-viacheslavo@nvidia.com> <20230609152847.32496-1-viacheslavo@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT014:EE_|PH7PR12MB5618:EE_ X-MS-Office365-Filtering-Correlation-Id: 1b51e0a2-568b-4ff3-380f-08db68fe4909 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sz9/raCDj9vlEwyswjb/YTsn0aMmV/jyDfBENUpTsFGIzA5E9WYQWNNk4gEn73xUcppe7CYk4ctM8bi+Dzf0FfUo0IU4w1qpTxNZTIlZ1/2Gf8zKZ2ygL4aPsySH8xUGch64Ss5idHY2gLMkJEpli2Iu3z8yzaW+SiUSnLK2Dst/5YCorgeaaaCDu52U+XZnj6ZcsdineDQBMMvnC8PDTuAh0EWEpGPVXBl68AGnl2zoxuTO85grFDkMXT+4+5y53eYkIy+3lXL4JnF52VSXK8PCQWYPEp1aeFUyyVPv7w9SyFoLTiARhEJlin+PsaK8+V1ocWxAwNBgQRIuqr5XU+qEhcBlYTl2bJqkJ54/7WObCqC9XfgFWL00CFSbc/HRCKHedV0qcseSbhimK4RkLiGBuSf+WmibQUWmdZXDIY/lEkAg3+JJG+ijbit3pGsG03FPGPD5hK3zgzq0eRg+LCWlO7EpmM0PqSar1b1t8p4Kjh2kkFKSwq7AJgKh2AUyGL7jTNEbiAEhe7a6CTjEiF84TK45JR5nvvZLuGfWR8RUstp86ytVn/Ixk3FoLsUgxnSy0RROVaT4H+ftVbG2SYdb60TxnebenKSYDuyQZkfICFgWAfKoDxnQBAyFMyMW3VcOwBdPjcUxvottqXxjnbQwn0iSTUOtw1byo0bpmSS7nDCJ6ArWtKNdCNxUTcuTG9mcYiimyEKcHnhXw+ksJSNb4g+5VEHsJehVDOFpiuk= X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230028)(4636009)(346002)(396003)(39860400002)(376002)(136003)(451199021)(40470700004)(46966006)(36840700001)(47076005)(336012)(426003)(40480700001)(478600001)(82740400003)(55016003)(8936002)(41300700001)(8676002)(356005)(316002)(70586007)(70206006)(7636003)(40460700003)(86362001)(6916009)(5660300002)(36756003)(6666004)(7696005)(2906002)(36860700001)(82310400005)(6286002)(26005)(186003)(16526019)(1076003)(2616005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2023 15:29:15.7661 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1b51e0a2-568b-4ff3-380f-08db68fe4909 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT014.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5618 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 There is an intention to engage DPDK tracing capabilities for mlx5 PMDs monitoring and profiling in various modes. The patch introduces tracepoints for the Tx datapath in the ethernet device driver. Signed-off-by: Viacheslav Ovsiienko --- drivers/common/mlx5/meson.build | 1 + drivers/common/mlx5/mlx5_trace.c | 25 +++++++++++ drivers/common/mlx5/mlx5_trace.h | 72 ++++++++++++++++++++++++++++++++ drivers/common/mlx5/version.map | 8 ++++ 4 files changed, 106 insertions(+) create mode 100644 drivers/common/mlx5/mlx5_trace.c create mode 100644 drivers/common/mlx5/mlx5_trace.h diff --git a/drivers/common/mlx5/meson.build b/drivers/common/mlx5/meson.build index 1eefc02f06..28bfbfa324 100644 --- a/drivers/common/mlx5/meson.build +++ b/drivers/common/mlx5/meson.build @@ -19,6 +19,7 @@ sources += files( 'mlx5_common_mp.c', 'mlx5_common_mr.c', 'mlx5_malloc.c', + 'mlx5_trace.c', 'mlx5_common_pci.c', 'mlx5_common_devx.c', 'mlx5_common_utils.c', diff --git a/drivers/common/mlx5/mlx5_trace.c b/drivers/common/mlx5/mlx5_trace.c new file mode 100644 index 0000000000..b9f14413ad --- /dev/null +++ b/drivers/common/mlx5/mlx5_trace.c @@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2022 NVIDIA Corporation & Affiliates + */ + +#include +#include + +RTE_TRACE_POINT_REGISTER(rte_pmd_mlx5_trace_tx_entry, + pmd.net.mlx5.tx.entry) + +RTE_TRACE_POINT_REGISTER(rte_pmd_mlx5_trace_tx_exit, + pmd.net.mlx5.tx.exit) + +RTE_TRACE_POINT_REGISTER(rte_pmd_mlx5_trace_tx_wqe, + pmd.net.mlx5.tx.wqe) + +RTE_TRACE_POINT_REGISTER(rte_pmd_mlx5_trace_tx_wait, + pmd.net.mlx5.tx.wait) + +RTE_TRACE_POINT_REGISTER(rte_pmd_mlx5_trace_tx_push, + pmd.net.mlx5.tx.push) + +RTE_TRACE_POINT_REGISTER(rte_pmd_mlx5_trace_tx_complete, + pmd.net.mlx5.tx.complete) + diff --git a/drivers/common/mlx5/mlx5_trace.h b/drivers/common/mlx5/mlx5_trace.h new file mode 100644 index 0000000000..57512e654f --- /dev/null +++ b/drivers/common/mlx5/mlx5_trace.h @@ -0,0 +1,72 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2022 NVIDIA Corporation & Affiliates + */ + +#ifndef RTE_PMD_MLX5_TRACE_H_ +#define RTE_PMD_MLX5_TRACE_H_ + +/** + * @file + * + * API for mlx5 PMD trace support + */ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include + +RTE_TRACE_POINT_FP( + rte_pmd_mlx5_trace_tx_entry, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(queue_id); +) + +RTE_TRACE_POINT_FP( + rte_pmd_mlx5_trace_tx_exit, + RTE_TRACE_POINT_ARGS(uint16_t nb_sent, uint16_t nb_req), + rte_trace_point_emit_u16(nb_sent); + rte_trace_point_emit_u16(nb_req); +) + +RTE_TRACE_POINT_FP( + rte_pmd_mlx5_trace_tx_wqe, + RTE_TRACE_POINT_ARGS(uint32_t opcode), + rte_trace_point_emit_u32(opcode); +) + +RTE_TRACE_POINT_FP( + rte_pmd_mlx5_trace_tx_wait, + RTE_TRACE_POINT_ARGS(uint64_t ts), + rte_trace_point_emit_u64(ts); +) + + +RTE_TRACE_POINT_FP( + rte_pmd_mlx5_trace_tx_push, + RTE_TRACE_POINT_ARGS(const struct rte_mbuf *mbuf, uint16_t wqe_id), + rte_trace_point_emit_ptr(mbuf); + rte_trace_point_emit_u32(mbuf->pkt_len); + rte_trace_point_emit_u16(mbuf->nb_segs); + rte_trace_point_emit_u16(wqe_id); +) + +RTE_TRACE_POINT_FP( + rte_pmd_mlx5_trace_tx_complete, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + uint16_t wqe_id, uint64_t ts), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(queue_id); + rte_trace_point_emit_u64(ts); + rte_trace_point_emit_u16(wqe_id); +) + +#ifdef __cplusplus +} +#endif + +#endif /* RTE_PMD_MLX5_TRACE_H_ */ diff --git a/drivers/common/mlx5/version.map b/drivers/common/mlx5/version.map index e05e1aa8c5..d0ec8571e6 100644 --- a/drivers/common/mlx5/version.map +++ b/drivers/common/mlx5/version.map @@ -158,5 +158,13 @@ INTERNAL { mlx5_os_interrupt_handler_create; # WINDOWS_NO_EXPORT mlx5_os_interrupt_handler_destroy; # WINDOWS_NO_EXPORT + + __rte_pmd_mlx5_trace_tx_entry; + __rte_pmd_mlx5_trace_tx_exit; + __rte_pmd_mlx5_trace_tx_wqe; + __rte_pmd_mlx5_trace_tx_wait; + __rte_pmd_mlx5_trace_tx_push; + __rte_pmd_mlx5_trace_tx_complete; + local: *; }; -- 2.18.1