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 8D83045AF1 for ; Wed, 9 Oct 2024 13:41:18 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D62064278E; Wed, 9 Oct 2024 13:41:17 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2063.outbound.protection.outlook.com [40.107.244.63]) by mails.dpdk.org (Postfix) with ESMTP id B0E8D42789; Wed, 9 Oct 2024 13:41:13 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=J019F9voMFjvkSggX3DivvMqb0jcm71lP60eo85QUhoTDION+HCfjn4bMUdHsGbh1Vv3As0V4FG8Ko/zXXGEv+S4SCd5/huXjvVQrB/nQIymROvhBuFrQKqhEskQO8XlhBF9FElwchK+aArEJuQ1PPsEY1rIngM7uH4Gh2Umwy+0uA9igwGB4Z8vos4msewQcM+luUfZqh32wnooNxI+Fzwfnp32JSIKHuE5PgQS2YUxOQ4yh5K4f77h/FTQSghvAIDfJ1nWr49Vq8hJok9pJUK1bUaR4aoGzyfLvvW37sehXxISrpZbOrbq0Pzd220U0KuXYvwcAWvGvLumSoByKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=S3u6bg0Zc3s2Ms/fbwQD+Otlv3peXxJv2A9RxEIyooQ=; b=GQmNasynmf+cHDEfvGS3i4q2BhtxaRMCw6QFtrIvnl9oR1v+pZefXDZ6seMqo5ASIE0pwlPe3GY0wxz3C+uoN4Ge8s8Me8ju6nqjd0FI7sOInu3++ih+N+ia7GMlMkqNuXM+K81I3E6toK2I+TWKvNyKWuIJbSKSAoiVWIv2HN7CKoIswgflNhqlJILt//5NwWmplpo7tJp2Ibm/MFnuTOPZdWUMON7NFxCx+CqRCuf50buXuphZaDT67wHaFMP05OoyDUi5xCnC6bSxTSUo3hGwIILfkpW4pWGgSw9eLRBPwnGcdYxZigDlic0CRbZxJW9xs2aXFmWkKeuRJnDfaA== 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 (0) 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=S3u6bg0Zc3s2Ms/fbwQD+Otlv3peXxJv2A9RxEIyooQ=; b=PasQqEkPhhcf7X2DROMEk/EgBL2dIZC5GnXEFGNGN4GOz8/xbRvzLRx1wJsNdRvEOS/GSuKU1JWwWMk8Fu/YnBr3GftMbxRRXsHuYr366TPLQvsCLuxuCM8Ps2161x0HCa14ptTvqtZF15O50lhLpo9dl1TtupSKr30RHyiXYjerIY3Sity22BXDrqOshotzBvq1m/9R/M+xBiEaZP3Aj+YZyAyQvoXi1ACttHpjoJ8Od3+ZINvyO3PiQTnCx7eLI5TcvV6hcNV1iRjaP2xx3V69mFL77w0VSXlD8tnHVnjIC5ifW8HAPuBP35AFK3CHsrxFxSlmeJUnPh+3ZKWZwA== Received: from CH5PR04CA0004.namprd04.prod.outlook.com (2603:10b6:610:1f4::10) by LV3PR12MB9214.namprd12.prod.outlook.com (2603:10b6:408:1a4::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.22; Wed, 9 Oct 2024 11:41:09 +0000 Received: from DS3PEPF000099DF.namprd04.prod.outlook.com (2603:10b6:610:1f4:cafe::28) by CH5PR04CA0004.outlook.office365.com (2603:10b6:610:1f4::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.17 via Frontend Transport; Wed, 9 Oct 2024 11:41:09 +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 DS3PEPF000099DF.mail.protection.outlook.com (10.167.17.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.13 via Frontend Transport; Wed, 9 Oct 2024 11:41:08 +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.1544.4; Wed, 9 Oct 2024 04:40:58 -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.1544.4; Wed, 9 Oct 2024 04:40:55 -0700 From: Viacheslav Ovsiienko To: CC: , , , , Tim Martin , Subject: [PATCH 3/4] net/mlx5: fix Tx tracing to use single clock source Date: Wed, 9 Oct 2024 14:40:27 +0300 Message-ID: <20241009114028.973284-4-viacheslavo@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241009114028.973284-1-viacheslavo@nvidia.com> References: <20241009114028.973284-1-viacheslavo@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: DS3PEPF000099DF:EE_|LV3PR12MB9214:EE_ X-MS-Office365-Filtering-Correlation-Id: 3f0ae2d3-9d75-4b5f-6c21-08dce857449f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|82310400026|36860700013|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?MECEAnTif7f3t14UTF42yfbon2pFPbGpSpyLMXv1lZF9Q16ufZSoQ5OrqrA8?= =?us-ascii?Q?2xS+kp88SZoFzptHIQRazgNJvaGj5ZiDoRzkhJ4a1MxSmePF/UxcytyL+k7i?= =?us-ascii?Q?rbRhzqq1VWDSK6f++6E/BDAICO9aZ5j13qQXLh54tNwtU8TIqyGHyO/IcpDV?= =?us-ascii?Q?DSiZ+8BBxe1NTMC5XrtyFLx/KC0q9xk2XNaRJN2DGEMaiWnoFmDrlZ5U0KII?= =?us-ascii?Q?gN73emXoLdVHBPTwH9huCWdiBgxT4MySGGSWrZ8PF5aK1ejXdKsfMJNjoxcE?= =?us-ascii?Q?/W/DpV/4z+oRQvcPtAv7wg7rIuqSDt5snfV9p9kUlTjM6gwfVpLJYmnaAFGF?= =?us-ascii?Q?TTgY+FOAGEbyWK9iX7VWwFbIwLw4krwVAdR8k8+sywl1vTkod+VHCK1jfIdQ?= =?us-ascii?Q?/vUmbQ/ib50NmKUK+VqQsMoVZwIOlq+0fNInigsBEse7EJL1ynGwtfnYiBAA?= =?us-ascii?Q?K9//dIS7K5HB5gnSWETUJLmbRH7Zp4WBQWkLdAdAMLGaCwwtaixVHJdxdwjQ?= =?us-ascii?Q?ETg8MG1tzgtUp0M6jZTffbTaiqzO8wqlmKNiEuSvH/zyD8kJSOinJVKINQ7K?= =?us-ascii?Q?55PMPOm7YwX8zCR2vmZVwJtAeS7Wn4m6Bf4BefTqXmzru0RleG70ynwXhZDR?= =?us-ascii?Q?MLx9QOmhf780T172E6fJlHeqEJ19QKvcbHxc+uFikgo6RegxsGEy7MXDD7O2?= =?us-ascii?Q?7bIW3ma+3gn7HhNpDD6IEQtiFgP7QQud8xxWnEG6XTFBnveRa+IcB0ijUppM?= =?us-ascii?Q?oLXsJZ1S5K18YQA521pzQ7T4EaCGLxbm/yuWhzMoekh7VDzzYpQX8jIQGLvt?= =?us-ascii?Q?I3KHzKai6J6uj+h4EvUr0HThJCFvzbQowALOYJavygBIZemwXXIFITuIEDec?= =?us-ascii?Q?gNP4e+m5+g302VewcSUcIdMPj81ZissX5yrTpzOl2r8OO5eMmBDQITdZH0+V?= =?us-ascii?Q?jYP4YRel+F8NdN7djjaGs+kEuETVX3DSQuDtdNgUsod2+1f5sJzW8+hEBp8X?= =?us-ascii?Q?kiK1jbufwuzKJoPZT4jc0p6fQhnzSeOkFBr6qe/QecUG/Adhu2CK6AKh3yDW?= =?us-ascii?Q?xdnA7vZ5tzFlIQ9Zqda+pmBVhzD/MgK7K8OvDohtKSC7aU1qx+o+BSXQclXi?= =?us-ascii?Q?Ntvbc6v+CD+qrFhz/mi3cgeaI18JluA28HfVaDomsklE7hSiQRhJryU/Uz3R?= =?us-ascii?Q?C5Y2hwRHyygojjVHM/56J4PAEfvEGRkOn5+ISykoet0BljmoTa5ElW8UDW5o?= =?us-ascii?Q?mkBcHK8zd++97X+eSGMI6WgzRJnux4WKgtbzavsWqgW7zOSG+dBhwzkDY9c+?= =?us-ascii?Q?eWs44aPmhsl0Tckps6SsAEoMIanzT3mXSeZdLlfkpKpxibIuDd6mqO7aFqvA?= =?us-ascii?Q?GSHd1Pc=3D?= 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:(13230040)(1800799024)(82310400026)(36860700013)(376014); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2024 11:41:08.9458 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3f0ae2d3-9d75-4b5f-6c21-08dce857449f 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: DS3PEPF000099DF.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR12MB9214 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org From: Tim Martin The prior commit introduced tracing for mlx5, but there is a mixture of two unrelated clocks used: the TSC for host work submission timestamps and the NIC HW clock for CQE completion times. It is necessary to have timestamps from a single common clock, and the NIC HW clock is the better choice since it can be used with externally synchronized clocks. This patch adds the NIC HW clock as an additional logged parameter for trace_tx_entry, trace_tx_exit, and trace_tx_wqe. The included trace analysis python script is also updated to use the new clock when it is available. Fixes: a1e910f5b8d4 ("net/mlx5: introduce tracepoints") Fixes: 9725191a7e14 ("net/mlx5: add Tx datapath trace analyzing script") Cc: stable@dpdk.org Signed-off-by: Tim Martin Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_trace.h | 9 ++++++--- drivers/net/mlx5/tools/mlx5_trace.py | 12 +++++++++--- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/drivers/net/mlx5/mlx5_trace.h b/drivers/net/mlx5/mlx5_trace.h index 888d96f60b..656dbb1a4f 100644 --- a/drivers/net/mlx5/mlx5_trace.h +++ b/drivers/net/mlx5/mlx5_trace.h @@ -22,21 +22,24 @@ extern "C" { /* TX burst subroutines trace points. */ 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_ARGS(uint64_t real_time, uint16_t port_id, uint16_t queue_id), + rte_trace_point_emit_u64(real_time); 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_ARGS(uint64_t real_time, uint16_t nb_sent, uint16_t nb_req), + rte_trace_point_emit_u64(real_time); 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_ARGS(uint64_t real_time, uint32_t opcode), + rte_trace_point_emit_u64(real_time); rte_trace_point_emit_u32(opcode); ) diff --git a/drivers/net/mlx5/tools/mlx5_trace.py b/drivers/net/mlx5/tools/mlx5_trace.py index 67461520a9..5eb634a490 100755 --- a/drivers/net/mlx5/tools/mlx5_trace.py +++ b/drivers/net/mlx5/tools/mlx5_trace.py @@ -174,7 +174,9 @@ def do_tx_entry(msg, trace): return # allocate the new burst and append to the queue burst = MlxBurst() - burst.call_ts = msg.default_clock_snapshot.ns_from_origin + burst.call_ts = event["real_time"] + if burst.call_ts == 0: + burst.call_ts = msg.default_clock_snapshot.ns_from_origin trace.tx_blst[cpu_id] = burst pq_id = event["port_id"] << 16 | event["queue_id"] queue = trace.tx_qlst.get(pq_id) @@ -194,7 +196,9 @@ def do_tx_exit(msg, trace): burst = trace.tx_blst.get(cpu_id) if burst is None: return - burst.done_ts = msg.default_clock_snapshot.ns_from_origin + burst.done_ts = event["real_time"] + if burst.done_ts == 0: + burst.done_ts = msg.default_clock_snapshot.ns_from_origin burst.req = event["nb_req"] burst.done = event["nb_sent"] trace.tx_blst.pop(cpu_id) @@ -210,7 +214,9 @@ def do_tx_wqe(msg, trace): wqe = MlxWqe() wqe.wait_ts = trace.tx_wlst.get(cpu_id) if wqe.wait_ts is None: - wqe.wait_ts = msg.default_clock_snapshot.ns_from_origin + wqe.wait_ts = event["real_time"] + if wqe.wait_ts == 0: + wqe.wait_ts = msg.default_clock_snapshot.ns_from_origin wqe.opcode = event["opcode"] burst.wqes.append(wqe) -- 2.34.1