[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250913062810.11141-1-litian@redhat.com>
Date: Sat, 13 Sep 2025 14:28:10 +0800
From: Li Tian <litian@...hat.com>
To: netdev@...r.kernel.org,
linux-hyperv@...r.kernel.org
Cc: linux-kernel@...r.kernel.org,
Saeed Mahameed <saeedm@...dia.com>,
Tariq Toukan <tariqt@...dia.com>,
Mark Bloch <mbloch@...dia.com>,
Leon Romanovsky <leon@...nel.org>,
linux-rdma@...r.kernel.org,
Haiyang Zhang <haiyangz@...rosoft.com>
Subject: [PATCH net] net/mlx5: report duplex full when speed is known
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@...hat.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
Powered by blists - more mailing lists