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 73E7142996; Thu, 20 Apr 2023 12:08:53 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C4D8D42C76; Thu, 20 Apr 2023 12:08:44 +0200 (CEST) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2075.outbound.protection.outlook.com [40.107.96.75]) by mails.dpdk.org (Postfix) with ESMTP id 5F70640687 for ; Thu, 20 Apr 2023 12:08:42 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H31+R6Wrjat0D8B2/pstwlI3qpktbCGMOLZvFKldW4/BsrNIABwmA1nge6oaHg44IQ/TDd+G340nGqF0VsQjBqcIYl+tQUj+zgQtKBMfAyBgQ6wIvWR2MY5J4t9veM+v5//ppE4me+9yfdO7rCsKDoy7c+Zt/gp2RWq8Toe1NwvQgMj4Ks95vQclJFpt9/41Fyfg84JinBn/zJFJgEfnP/bIE699wLUzfRqPsvIwZtI07okKfGbUEoQdWEhWP4znZFVwt3k8ZP4Co81JRt0yiU+jXg6dtv/pJ0U21LnnaciBrXFFLzE3t6Vl51Rx0HJrSiFXRafUCQ5Uv5b32nhF5Q== 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=2Rz1Mh30mVjoIJeK3n7nCLiWPZsmMknPnnqBaJo5kJc=; b=U2pzvFlRVIwH869mQYm+/Qr1DFVdmb+udFPIYN0ObkNWArtEY9Z2rt8oCEExZH7q5D9be+HUg8icIrEAwjlQ/Cs5AbqfjENDp5oG5Pc1gf0cSGUW/N3OJ1aw3Z/gCA+WpzI1ZEjDKyXMqzBXmjwZlveGEEDssE0a0yR8ZKGVae8XeAXaMyDmY3VHNdcfGnxV28y91CvfjozVdQ3C4jsGlZucJlx4YSZcF2C1h9Mb3jV5P3Hgm9UcbdgpHIWHR601zqis6A6HuqobOPQ7xAGTrx0HkYqZLfL8o2J+mSv+24VxqO/cxx0Zz37/75Gsjl6QiOGGYfTrIBaK/k4y40ZSbw== 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=2Rz1Mh30mVjoIJeK3n7nCLiWPZsmMknPnnqBaJo5kJc=; b=NcrUIHIJwKFhi1ECg4ci2bfN28CcYv2bCkq2+lUSY57vOLp68K0xveIH8kf+teiqjdk/4Fi21NLYYfCE9qE37yX37pCznFHPLTRb1jA6mrUKUybVZbGxRoy30BhOpx5dz5V+aC99SFMEUKrzhbzaKLvBT6aKqRqzlNpo2x43HJm0b2VXllXjbOcDRT6i9gAny9mpE3+lBLMVHs15V74LfWKjvVEsJSSV2WP022jcopYvO2iAvZxKiCrAlMBSrNVdm3WTEEqucdvt0AuP0FTBHFjtSMw45cCuHn21TDCvi4fZywOnnS5Seu4cPFWcNVMWkWg9eL41Qx3gUXg5Ihm19w== Received: from DM6PR18CA0007.namprd18.prod.outlook.com (2603:10b6:5:15b::20) by PH7PR12MB7163.namprd12.prod.outlook.com (2603:10b6:510:202::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.33; Thu, 20 Apr 2023 10:08:40 +0000 Received: from DM6NAM11FT044.eop-nam11.prod.protection.outlook.com (2603:10b6:5:15b:cafe::96) by DM6PR18CA0007.outlook.office365.com (2603:10b6:5:15b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.24 via Frontend Transport; Thu, 20 Apr 2023 10:08:40 +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 DM6NAM11FT044.mail.protection.outlook.com (10.13.173.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.23 via Frontend Transport; Thu, 20 Apr 2023 10:08:40 +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; Thu, 20 Apr 2023 03:08:28 -0700 Received: from nvidia.com (10.126.230.37) 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; Thu, 20 Apr 2023 03:08:27 -0700 From: Viacheslav Ovsiienko To: Subject: [RFC 2/5] common/mlx5: introduce tracepoints for mlx5 drivers Date: Thu, 20 Apr 2023 13:08:00 +0300 Message-ID: <20230420100803.494-3-viacheslavo@nvidia.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20230420100803.494-1-viacheslavo@nvidia.com> References: <20230420100803.494-1-viacheslavo@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.126.230.37] 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: DM6NAM11FT044:EE_|PH7PR12MB7163:EE_ X-MS-Office365-Filtering-Correlation-Id: e3d679b2-151a-4ff1-aa1f-08db41873743 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5pcndHI+HiVNu7TWtmJWfzc0n6TN20Ris3fK+2y4w2R+IBYmDT+PURX+eEB0hoIHqknTEJdZAH6xBvRbGNsA+T23Bju1FxGaaXMCtyGyQhcUu/OUigOBPOF18sE1n8RlZFeVK9TeJwYetkcbpY0CY78/SJf/8A9BNY0xMqqMsLTg6sr1HQEicTP87EvQwEPpRPZMgRl6dZLYZSL2/LS1CHDUdpXneFCcKXz+EGqxEqwYtasfwPT8rOhMwLdGuI7cdoCkFF/v1bwrklLoj6Ubx1kv6ci/MbwEuDIFDSt8hX3RpDxGQybX4JXruYuFcc7XT4eNEXyluU+hPnoKJY+L/mZa9u18AHYtZ8RsEClj0RjWNSSX8G6w+ARwfzfwdH5ouAekH2hr3bfb6ZsQOvz7QSISveIsJqP8iP8KQKt+MuCMxuc5GR2wO5r9zOOeWxJ5yP1fPhH3JIclEjf2HkFkPcKU7nKpW6U2NLCZmMPnu7GxIN2JwsrrX8DaaoeHf4POyvFyeSjKv5RuA+qg2ExS4pqs4Nz4rwNOEzcNayi3gJKgJYkn3c/uxDYGvc3bePSJFWQBit+ObMlX9tE0pX3m4F+DevkVJFHpxJh1VnfixMp8grYlcXMQA+XSc7mUQIKwqVwdt20lBp7YgPoLU48Eb3BxiK+9f8+wKl0lAb+5tVq9dZ2nOGLX8i0KKYSjcVeDkkI44jsrVxEFsiKih5FL2eTc58GWq5aE66SmBm61vXP+uw9JLadEtAZe8qGvQpadX82Um80Q1ICI6Eovz0kstQ== 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)(376002)(396003)(39860400002)(136003)(346002)(451199021)(46966006)(36840700001)(40470700004)(36756003)(34020700004)(86362001)(8676002)(316002)(7696005)(6916009)(70206006)(336012)(478600001)(41300700001)(70586007)(47076005)(5660300002)(356005)(55016003)(2906002)(8936002)(40480700001)(7636003)(82310400005)(82740400003)(6286002)(36860700001)(186003)(16526019)(1076003)(426003)(26005)(2616005)(6666004)(40460700003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Apr 2023 10:08:40.5222 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e3d679b2-151a-4ff1-aa1f-08db41873743 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: DM6NAM11FT044.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7163 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 9dc809f192..e074ffb140 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