From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5B792C433FE for ; Tue, 22 Nov 2022 02:28:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229682AbiKVC2e (ORCPT ); Mon, 21 Nov 2022 21:28:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231747AbiKVC22 (ORCPT ); Mon, 21 Nov 2022 21:28:28 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3269209BE for ; Mon, 21 Nov 2022 18:28:27 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 25640B8190F for ; Tue, 22 Nov 2022 02:28:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C97F5C433C1; Tue, 22 Nov 2022 02:28:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669084104; bh=jiB8AjiVr2nypJFOimxpcfF7WAemdV5V2IyE78WWdj8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NbfMQGSyqAGhyX0mlOFkhfrleIjQRR38npVSFzGHo2+pYh2ZA9E+/TBC9WnuNig70 amc2oKp3OHQa+rCY2ehKlasoGX3a71HGGqswVXNEwhCP163FqkRAB337Zz1PsApJAl LLD8aOq+dT7Se6oD4eMQUNK8VDAheTo/jKE3oQEsJCz/P7eKFPb7YG6hi5nm1dSNl0 DSMEWb5ed/52sON3IlDD8mf+lICqppXlOpg07KhVKFRd87Olez2vmEvShmpRnSfAQu C8x8RPtHQVdrW1D0L4idGukcI+jsoY6T54zWMyfL6N6f+PBg8eOIhWbozSDtj0gnpW P6TVV9uiaENhA== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet Cc: Saeed Mahameed , netdev@vger.kernel.org, Tariq Toukan , Moshe Shemesh , Feras Daoud Subject: [net 02/14] net/mlx5: Fix FW tracer timestamp calculation Date: Mon, 21 Nov 2022 18:25:47 -0800 Message-Id: <20221122022559.89459-3-saeed@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221122022559.89459-1-saeed@kernel.org> References: <20221122022559.89459-1-saeed@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Moshe Shemesh 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: 70dd6fdb8987 ("net/mlx5: FW tracer, parse traces and kernel tracing support") Signed-off-by: Moshe Shemesh Reviewed-by: Feras Daoud Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c b/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c index 978a2bb8e122..21831386b26e 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c @@ -638,7 +638,7 @@ static void mlx5_tracer_handle_timestamp_trace(struct mlx5_fw_tracer *tracer, trace_timestamp = (timestamp_event.timestamp & MASK_52_7) | (str_frmt->timestamp & MASK_6_0); 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); mlx5_tracer_print_trace(str_frmt, dev, trace_timestamp); -- 2.38.1