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 98B9F42CA7; Tue, 13 Jun 2023 18:59:25 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 49D4241611; Tue, 13 Jun 2023 18:59:21 +0200 (CEST) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2077.outbound.protection.outlook.com [40.107.101.77]) by mails.dpdk.org (Postfix) with ESMTP id 19E3440A8A for ; Tue, 13 Jun 2023 18:59:20 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i/jmHSBo3DPNk/bOxzQa31UB0JFKke4ETofhfLCRXKYXeFphjsnEGxxwmZ7/yGT+2DfNtefJDGPZ3CVietagSACYB3DFb2k+SyHujquboA7wadUXOzT3u4kgd2HDOgADo7nX5/e5nKK3wLwE3AVxt51fR33LXiqvQPD8RwKJsGaGHiqStkU0KHlfym+rPiehVFbMm5VoGsDqYfyCr3Busg4Z+zSsRxuu3p26uvYRmxxHyQFW/+tw72/oUh/8hQQtOlmVJC0hFwCjrc4HjkqAr06aV6SoD3lG05AYwm/phjhseQcqQGOZO30sK53nnrDtHa2968l7NMXuMwzu8Evi7g== 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=BehCa3S4ky+uhwcrfFC1sZfSyozSoFqG0WXw2ZzPuAPi9GLBDD+sIHu5xN26N0GRcJzsVNQVHKoVq6o/8ZEXkDU28UGn3FjcGRQqOPzUo75ax67D77v1XfeYq0pINU/+NSUru0Jc21pHmNM0JIJNAuIsZQoytS0SYLrWB8RfOaL5ZByU9HEt0JUgXdQx0gx3iOd3/e7AlMTRluNb1aWN+8QxNRaWK0cr8IkAF0ruw7uTbUjkNVzdTwDXfxHP3i2R47kqTt7cx1aXfVsDk9O6F9uR5/H52j6tzN/OC3hRyKIOHzcBC5CNeoSCs4GIWE/t57m67wYGgfpojIgirbK0mw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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=PTzPZDF2Kkz4Kiz2JReNOt4Ultohb9ZC2jZAB+8nl6/rW4QLCU1M7RWW6T/y73NquwK4bZYUl+/spKWLXiIsKNCwrIqJOGqIFBOlJtNwJmTxR7U4e7KXlPSmMsrUHvUkd548xcBFuWgNENZ5SCPNVqK2yrJOw6KbmD3GqZWs6Ki4vhw5AJKEy1kBhTJ4JHP4Wn1lf/h5QeSSvfZ+Vq3ej24K/HEeA6aFgowPiHWd6UNH3+ooksump4ai5WeOxFY13Q2+66UdIAP9GbdH+A8SS/FNpXchlc5JOOuZEtBcjT07DvKpGhzkS6ViGmCiZXto+CwQS3BgztDY2S0szz6QbA== Received: from DS7PR03CA0178.namprd03.prod.outlook.com (2603:10b6:5:3b2::33) by CH3PR12MB8484.namprd12.prod.outlook.com (2603:10b6:610:158::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6477.29; Tue, 13 Jun 2023 16:59:18 +0000 Received: from DM6NAM11FT075.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b2:cafe::79) by DS7PR03CA0178.outlook.office365.com (2603:10b6:5:3b2::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6477.35 via Frontend Transport; Tue, 13 Jun 2023 16:59:18 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by DM6NAM11FT075.mail.protection.outlook.com (10.13.173.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.23 via Frontend Transport; Tue, 13 Jun 2023 16:59:17 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 13 Jun 2023 09:59:05 -0700 Received: from nvidia.com (10.126.231.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; Tue, 13 Jun 2023 09:59:04 -0700 From: Viacheslav Ovsiienko To: Subject: [PATCH v2 2/5] common/mlx5: introduce tracepoints for mlx5 drivers Date: Tue, 13 Jun 2023 19:58:42 +0300 Message-ID: <20230613165845.19109-3-viacheslavo@nvidia.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20230613165845.19109-1-viacheslavo@nvidia.com> References: <20230420100803.494-1-viacheslavo@nvidia.com> <20230613165845.19109-1-viacheslavo@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT075:EE_|CH3PR12MB8484:EE_ X-MS-Office365-Filtering-Correlation-Id: aae1019d-554c-401c-0b17-08db6c2f869b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mHA/z4ai3u5wXFrlLxGvNdKTSwpQy3PNUViej4T60Wthr2ZTxA4QmRsVH8jcRJTUnkfBI971zjZTsMBawxSiYZo+pomf4ksLzY8x+9iAmWXnHGDfG92pP2bFHJlwSzryblFo50/E6IuHJKng22ZNVAqh9K/dk+1Q2uzjQmRgvCo1u78BEKnEcGM78/ovxVIzoV2uSEIkkuyzAUPfrwk7DVWlz8j5zXH4UkPV3HNWcnmX1PO66l7+8ySESdXXkICyyn6fHaLs2Mcx229vwFjxnK9I15W6+TC1YbPdVgz05KjlMBdi/laeXHjTBZUTUf88MFMO0dLu4qAL2QUA0j3zmgNbPOcktCF/MmUE2xLkoND9Y4o2lm+44OreKD8qH4TL2wxv8gG/3hKNWiwr6tYJA+TPmg6WiiBTu4J3n2Ls3C4qff03lHjEZiq+05pmBE4j0R+gWMYzoKbXts3Lb6iGw8u0MWCkATKjJz6hhzzqKpKBsmrlmUII3ZPcZ95EomZKNhXTK42Ld+va4QUyhKOLGJMqa68GCFL/O9Ew+bkyakS5KEkc/lAmFqwBa6fbBZK3mpglhwgp3m/d3Nn/xwB5mvG/TyNiXQr4tVAmR4AB7sJVSvusD040mE56FxmXT/MCATaL9VETKYacuqZl5FRYnjb7/ydibPQh/BGq569LpADGfbNZit0A+x1lEicx8dr769x2KDG6r0JLYZKIcuZZ6FfasDYJ104koftD5mxvC3c= X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230028)(4636009)(39860400002)(136003)(376002)(396003)(346002)(451199021)(46966006)(40470700004)(36840700001)(426003)(336012)(2616005)(47076005)(36860700001)(7636003)(82740400003)(356005)(86362001)(40480700001)(55016003)(82310400005)(36756003)(40460700003)(478600001)(7696005)(6666004)(8936002)(8676002)(2906002)(5660300002)(70206006)(70586007)(6916009)(316002)(186003)(16526019)(6286002)(41300700001)(26005)(1076003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2023 16:59:17.9065 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: aae1019d-554c-401c-0b17-08db6c2f869b 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.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT075.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8484 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