]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net/mlx5: Fix fw tracer first block check
authorMoshe Shemesh <moshe@nvidia.com>
Thu, 30 Nov 2023 09:30:34 +0000 (11:30 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Jan 2024 14:13:29 +0000 (15:13 +0100)
[ Upstream commit 4261edf11cb7c9224af713a102e5616329306932 ]

While handling new traces, to verify it is not the first block being
written, last_timestamp is checked. But instead of checking it is non
zero it is verified to be zero. Fix to verify last_timestamp is not
zero.

Fixes: c71ad41ccb0c ("net/mlx5: FW tracer, events handling")
Signed-off-by: Moshe Shemesh <moshe@nvidia.com>
Reviewed-by: Feras Daoud <ferasda@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c

index b69ab30ecf03bb2f0ed364876d2a34d1b1d67a20..efa2e0a8fa1d1284d30683bd417fcd813f98e007 100644 (file)
@@ -691,7 +691,7 @@ static void mlx5_fw_tracer_handle_traces(struct work_struct *work)
 
        while (block_timestamp > tracer->last_timestamp) {
                /* Check block override if it's not the first block */
-               if (!tracer->last_timestamp) {
+               if (tracer->last_timestamp) {
                        u64 *ts_event;
                        /* To avoid block override be the HW in case of buffer
                         * wraparound, the time stamp of the previous block