[PATCH net-next] net/mlx5e: Remove _once from PCI heuristic debug print

Tariq Toukan posted 1 patch 1 day, 13 hours ago
drivers/net/ethernet/mellanox/mlx5/core/en/params.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH net-next] net/mlx5e: Remove _once from PCI heuristic debug print
Posted by Tariq Toukan 1 day, 13 hours ago
From: Gal Pressman <gal@nvidia.com>

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.

Signed-off-by: Gal Pressman <gal@nvidia.com>
Reviewed-by: Alex Lazar <alazar@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en/params.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/params.c b/drivers/net/ethernet/mellanox/mlx5/core/en/params.c
index 1f4a547917ba..5caf7820a136 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/params.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/params.c
@@ -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
-- 
2.44.0