Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5c12136c authored by Moshe Shemesh's avatar Moshe Shemesh Committed by Greg Kroah-Hartman
Browse files

net/mlx5: Fix FW tracer timestamp calculation



[ Upstream commit 61db3d7b99a367416e489ccf764cc5f9b00d62a1 ]

Fix a bug in calculation of FW tracer timestamp. Decreasing one in the
calculation should effect only bits 52_7 and not effect bits 6_0 of the
timestamp, otherwise bits 6_0 are always set in this calculation.

Fixes: 70dd6fdb ("net/mlx5: FW tracer, parse traces and kernel tracing support")
Signed-off-by: default avatarMoshe Shemesh <moshe@nvidia.com>
Reviewed-by: default avatarFeras Daoud <ferasda@nvidia.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 00492f82
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -636,7 +636,7 @@ static void mlx5_tracer_handle_timestamp_trace(struct mlx5_fw_tracer *tracer,
			trace_timestamp = (timestamp_event.timestamp & MASK_52_7) |
			trace_timestamp = (timestamp_event.timestamp & MASK_52_7) |
					  (str_frmt->timestamp & MASK_6_0);
					  (str_frmt->timestamp & MASK_6_0);
		else
		else
			trace_timestamp = ((timestamp_event.timestamp & MASK_52_7) - 1) |
			trace_timestamp = ((timestamp_event.timestamp - 1) & MASK_52_7) |
					  (str_frmt->timestamp & MASK_6_0);
					  (str_frmt->timestamp & MASK_6_0);


		mlx5_tracer_print_trace(str_frmt, dev, trace_timestamp);
		mlx5_tracer_print_trace(str_frmt, dev, trace_timestamp);