Commit 9dd3d5d2 authored by Shahar Shitrit's avatar Shahar Shitrit Committed by Jakub Kicinski
Browse files

net/mlx5: Apply rate-limiting to high temperature warning



Wrap the high temperature warning in a temperature event with
a call to net_ratelimit() to prevent flooding the kernel log
with repeated warning messages when temperature exceeds the
threshold multiple times within a short duration.

Signed-off-by: default avatarShahar Shitrit <shshitrit@nvidia.com>
Signed-off-by: default avatarTariq Toukan <tariqt@nvidia.com>
Reviewed-by: default avatarMateusz Polchlopek <mateusz.polchlopek@intel.com>
Link: https://patch.msgid.link/20250213094641.226501-2-tariqt@nvidia.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 6626f11c
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -165,6 +165,7 @@ static int temp_warn(struct notifier_block *nb, unsigned long type, void *data)
	value_lsb = be64_to_cpu(eqe->data.temp_warning.sensor_warning_lsb);
	value_msb = be64_to_cpu(eqe->data.temp_warning.sensor_warning_msb);

	if (net_ratelimit())
		mlx5_core_warn(events->dev,
			       "High temperature on sensors with bit set %llx %llx",
			       value_msb, value_lsb);