From: Chris Babroski <hidden> Date: 2025-08-13 16:34:38
The "Speed" and "Duplex" fields displayed by ethtool should report
"Unknown" when the link is down. Currently, the driver always reports
the initially configured link speed and duplex, regardless of the actual
link state.
Implement a get_link_ksettings() callback to update the values reported
to ethtool based on the link state. When the link is down, the driver
now reports unknown speed and duplex as expected.
Signed-off-by: Chris Babroski <redacted>
---
.../mellanox/mlxbf_gige/mlxbf_gige_ethtool.c | 26 ++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
From: Jakub Kicinski <kuba@kernel.org> Date: 2025-08-15 19:11:03
On Wed, 13 Aug 2025 12:33:46 -0400 Chris Babroski wrote:
The "Speed" and "Duplex" fields displayed by ethtool should report
"Unknown" when the link is down. Currently, the driver always reports
the initially configured link speed and duplex, regardless of the actual
link state.
Implement a get_link_ksettings() callback to update the values reported
to ethtool based on the link state. When the link is down, the driver
now reports unknown speed and duplex as expected.
If that's the correct thing to do why is
phy_ethtool_get_link_ksettings() not doing it?
Please explain what makes mlxbf special, and make sure to CC PHY
maintainers on v2.
--
pw-bot: cr
From: Chris Babroski <hidden> Date: 2025-08-26 18:46:17
Hi Jakub,
Thanks for the feedback.
If that's the correct thing to do why is
phy_ethtool_get_link_ksettings() not doing it?
If I understand correctly, phy_ethtool_get_link_ksettings() reads
cached values that are updated when phy_read_status() is called by the
phy state machine. Doing "ifconfig down" will eventually trigger
phy_stop() in the ndo_stop() handler. This halts the phy state machine
and sets phydev->link without calling phy_read_status() or explicitly
setting other values, like speed and duplex.
It seems this is expected behavior with phylib, but I'm not familiar
with the implementation history. CC'd PHY maintainers for additional
input.
Please explain what makes mlxbf special
BlueField is unique in that the phy is hardwired to an internal switch
and so the physical link between the phy and link partner is always
up. This will also affect what link settings are reported by the phy.
This patch comes from a desire for ethtool output behavior to be the
same when an administrative link down is issued on the BlueField OOB
(mlxbf_gige) and NIC (mlx5) interfaces. The mlx5 driver implements
custom get_link_ksettings() handlers and does not use phylib.
Best,
Chris