Skip to content

Commit eecda80

Browse files
Shahar Shitritopsiff
authored andcommitted
net/mlx5: Apply rate-limiting to high temperature warning
[ Upstream commit 9dd3d5d ] 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: Shahar Shitrit <shshitrit@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Reviewed-by: Mateusz Polchlopek <mateusz.polchlopek@intel.com> Link: https://patch.msgid.link/20250213094641.226501-2-tariqt@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org> (cherry picked from commit 3ec539f1e9195d062ae4553c6eed665cef2acde5)
1 parent a0379e4 commit eecda80

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

  • drivers/net/ethernet/mellanox/mlx5/core

drivers/net/ethernet/mellanox/mlx5/core/events.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,10 @@ static int temp_warn(struct notifier_block *nb, unsigned long type, void *data)
169169
value_lsb &= 0x1;
170170
value_msb = be64_to_cpu(eqe->data.temp_warning.sensor_warning_msb);
171171

172-
mlx5_core_warn(events->dev,
173-
"High temperature on sensors with bit set %llx %llx",
174-
value_msb, value_lsb);
172+
if (net_ratelimit())
173+
mlx5_core_warn(events->dev,
174+
"High temperature on sensors with bit set %llx %llx",
175+
value_msb, value_lsb);
175176

176177
return NOTIFY_OK;
177178
}

0 commit comments

Comments
 (0)