net: phy: c45: improve handling of disabled EEE modes in generic ethtool functions
Subsystems (3)
Heiner Kallweit
maintainerPATCH 1/1 net: phy: c45: improve handling of disabled EEE modes in generic ethtool functions
Currently disabled EEE modes are shown as supported in ethtool. Change this by filtering them out when populating data->supported in genphy_c45_ethtool_get_eee.
Disabled EEE modes are silently filtered out by genphy_c45_write_eee_adv. This is planned to be removed, therefore ensure in genphy_c45_ethtool_set_eee that disabled EEE modes are removed from the user space provided EEE advertisement. For now keep the current behavior to do this silently.
--- drivers/net/phy/phy-c45.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/net/phy/phy-c45.c +5 -3
@@ -1525,8 +1525,8 @@ int genphy_c45_ethtool_get_eee(struct phy_device *phydev,return ret; data->eee_active = phydev->eee_active; -linkmode_copy (data->supported, phydev->supported_eee); - +linkmode_andnot (data->supported, phydev->supported_eee, + phydev->eee_disabled_modes);return 0 ; }EXPORT_SYMBOL (genphy_c45_ethtool_get_eee);
@@ -1559,7 +1559,9 @@ int genphy_c45_ethtool_set_eee(struct phy_device *phydev,phydev_warn (phydev,"At least some EEE link modes are not supported.\n" );return -EINVAL ; } -linkmode_copy (phydev->advertising_eee, adv); + +linkmode_andnot (phydev->advertising_eee, adv, + phydev->eee_disabled_modes); }else if (linkmode_empty (phydev->advertising_eee)) {phy_advertise_eee_all (phydev); }
Signature · 1 line
2.48.1
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 10 lines · On Wed, 12 Feb 2025 21:01:42 +0100 you wrote:
Currently disabled EEE modes are shown as supported in ethtool. Change this by filtering them out when populating
data->supportedingenphy_c45_ethtool_get_eee.
Disabled EEE modes are silently filtered out bygenphy_c45_write_eee_adv. This is planned to be removed, therefore ensure ingenphy_c45_ethtool_set_eeethat disabled EEE modes are removed from the user space provided EEE advertisement. For now keep the current behavior to do this silently.[...]
Here is the summary with links:
- [net-next] net: phy: c45: improve handling of disabled EEE modes in generic ethtool functions
https://git.kernel.org/netdev/net-next/c/0025fa45253c
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html