net/mlx5e: Remove _once from PCI heuristic debug print
Subsystems (4)
Tariq Toukan
maintainerPATCH 1/1 net/mlx5e: Remove _once from PCI heuristic debug print
From: Gal Pressman <[email protected]>
The _once rate-limiting in slow_pci_heuristic() is unnecessary because this function only runs during probe.
Worse, it interacts poorly with dynamic debug: if the first probe happens before dynamic debug is enabled for this callsite, the _once flag is permanently consumed and the message becomes unreachable without reloading the module.
Additionally, only the first probed device values were printable in case of multiple devices.
Replace with mlx5_core_dbg() which allows enabling the print via dynamic debug at any time and observing it on the next probe.
--- drivers/net/ethernet/mellanox/mlx5/core/en/params.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en/params.c +2 -2
@@ -545,8 +545,8 @@ bool slow_pci_heuristic(struct mlx5_core_dev *mdev)mlx5_port_max_linkspeed (mdev, &link_speed); pci_bw =pcie_bandwidth_available (mdev->pdev,NULL ,NULL ,NULL ); -mlx5_core_dbg_once (mdev,"Max link speed = %d, PCI BW = %d\n" , - link_speed, pci_bw); +mlx5_core_dbg (mdev,"Max link speed = %d, PCI BW = %d\n" , link_speed, + pci_bw);#define MLX5E_SLOW_PCI_RATIO (2)
base-commit: 1df10cef2d1e7f9f2fb7eddb67fc70d3abf101f9
Signature · 1 line
2.44.0
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 5 lines · On Thu, 23 Jul 2026 11:17:43 +0300 you wrote:
From: Gal Pressman <[email protected]>
The
_oncerate-limiting inslow_pci_heuristic()is unnecessary because this function only runs during probe.
Quoted 8 lines
Worse, it interacts poorly with dynamic debug: if the first probe happens before dynamic debug is enabled for this callsite, the
_onceflag is permanently consumed and the message becomes unreachable without reloading the module.
Additionally, only the first probed device values were printable in case of multiple devices.[...]
Here is the summary with links:
- [net-next] net/mlx5e: Remove _once from PCI heuristic debug print
https://git.kernel.org/netdev/net-next/c/e4213520e976
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html