Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net/mlx5: fw_tracer, Zero consumer index when reloading the tracer

When tracer is reloaded, the device will log the traces at the
beginning of the log buffer. Also, driver is reading the log buffer in
chunks in accordance to the consumer index.
Hence, zero consumer index when reloading the tracer.

Fixes: 4383cfcc65e7 ("net/mlx5: Add devlink reload")
Signed-off-by: Shay Drory <shayd@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>

authored by

Shay Drory and committed by
Saeed Mahameed
184e1e44 db561fed

+1 -1
+1 -1
drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c
··· 757 757 if (err) 758 758 mlx5_core_warn(dev, "FWTracer: Failed to set tracer configurations %d\n", err); 759 759 760 + tracer->buff.consumer_index = 0; 760 761 return err; 761 762 } 762 763 ··· 822 821 mlx5_core_dbg(tracer->dev, "FWTracer: ownership changed, current=(%d)\n", tracer->owner); 823 822 if (tracer->owner) { 824 823 tracer->owner = false; 825 - tracer->buff.consumer_index = 0; 826 824 return; 827 825 } 828 826