Linux-HyperV List
 help / color / mirror / Atom feed
* [PATCH net] net/mlx5: report duplex full when speed is known
@ 2025-09-13  6:28 Li Tian
  2025-09-13 13:47 ` Andrew Lunn
  0 siblings, 1 reply; 4+ messages in thread
From: Li Tian @ 2025-09-13  6:28 UTC (permalink / raw)
  To: netdev, linux-hyperv
  Cc: linux-kernel, Saeed Mahameed, Tariq Toukan, Mark Bloch,
	Leon Romanovsky, linux-rdma, Haiyang Zhang

Prior commit in Fixes, duplex is always reported full as long
as the speed is known. Restore this behavior. Besides, modern
Mellanox doesn't seem to care about half duplex. This change
mitigates duplex unknown issue on Azure Mellanox 5.

Fixes: c268ca6087f55 ("net/mlx5: Expose port speed when possible")
Signed-off-by: Li Tian <litian@redhat.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
index d507366d773e..9f35d3b491e0 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
@@ -1118,9 +1118,11 @@ static void get_link_properties(struct net_device *netdev,
 	if (info) {
 		speed = info->speed;
 		lanes = info->lanes;
-		duplex = DUPLEX_FULL;
 	} else if (data_rate_oper)
 		speed = 100 * data_rate_oper;
+	if (!speed)
+		goto out;
+	duplex = DUPLEX_FULL;
 
 out:
 	link_ksettings->base.duplex = duplex;
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-09-14  3:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-13  6:28 [PATCH net] net/mlx5: report duplex full when speed is known Li Tian
2025-09-13 13:47 ` Andrew Lunn
2025-09-14  2:22   ` Li Tian
2025-09-14  3:25     ` Andrew Lunn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox