Skip to content

Commit 5cd349c

Browse files
pgreenwaanguy11
authored andcommitted
ice: report supported and advertised autoneg using PHY capabilities
Ethtool incorrectly reported supported and advertised auto-negotiation settings for a backplane PHY image which did not support auto-negotiation. This can occur when using media or PHY type for reporting ethtool supported and advertised auto-negotiation settings. Remove setting supported and advertised auto-negotiation settings based on PHY type in ice_phy_type_to_ethtool(), and MAC type in ice_get_link_ksettings(). Ethtool supported and advertised auto-negotiation settings should be based on the PHY image using the AQ command get PHY capabilities with media. Add setting supported and advertised auto-negotiation settings based get PHY capabilities with media in ice_get_link_ksettings(). Fixes: 48cb27f ("ice: Implement handlers for ethtool PHY/link operations") Signed-off-by: Paul Greenwalt <[email protected]> Tested-by: Tony Brelinski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent c7ee6ce commit 5cd349c

File tree

1 file changed

+6
-45
lines changed

1 file changed

+6
-45
lines changed

drivers/net/ethernet/intel/ice/ice_ethtool.c

Lines changed: 6 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1773,49 +1773,6 @@ ice_phy_type_to_ethtool(struct net_device *netdev,
17731773
ice_ethtool_advertise_link_mode(ICE_AQ_LINK_SPEED_100GB,
17741774
100000baseKR4_Full);
17751775
}
1776-
1777-
/* Autoneg PHY types */
1778-
if (phy_types_low & ICE_PHY_TYPE_LOW_100BASE_TX ||
1779-
phy_types_low & ICE_PHY_TYPE_LOW_1000BASE_T ||
1780-
phy_types_low & ICE_PHY_TYPE_LOW_1000BASE_KX ||
1781-
phy_types_low & ICE_PHY_TYPE_LOW_2500BASE_T ||
1782-
phy_types_low & ICE_PHY_TYPE_LOW_2500BASE_KX ||
1783-
phy_types_low & ICE_PHY_TYPE_LOW_5GBASE_T ||
1784-
phy_types_low & ICE_PHY_TYPE_LOW_5GBASE_KR ||
1785-
phy_types_low & ICE_PHY_TYPE_LOW_10GBASE_T ||
1786-
phy_types_low & ICE_PHY_TYPE_LOW_10GBASE_KR_CR1 ||
1787-
phy_types_low & ICE_PHY_TYPE_LOW_25GBASE_T ||
1788-
phy_types_low & ICE_PHY_TYPE_LOW_25GBASE_CR ||
1789-
phy_types_low & ICE_PHY_TYPE_LOW_25GBASE_CR_S ||
1790-
phy_types_low & ICE_PHY_TYPE_LOW_25GBASE_CR1 ||
1791-
phy_types_low & ICE_PHY_TYPE_LOW_25GBASE_KR ||
1792-
phy_types_low & ICE_PHY_TYPE_LOW_25GBASE_KR_S ||
1793-
phy_types_low & ICE_PHY_TYPE_LOW_25GBASE_KR1 ||
1794-
phy_types_low & ICE_PHY_TYPE_LOW_40GBASE_CR4 ||
1795-
phy_types_low & ICE_PHY_TYPE_LOW_40GBASE_KR4) {
1796-
ethtool_link_ksettings_add_link_mode(ks, supported,
1797-
Autoneg);
1798-
ethtool_link_ksettings_add_link_mode(ks, advertising,
1799-
Autoneg);
1800-
}
1801-
if (phy_types_low & ICE_PHY_TYPE_LOW_50GBASE_CR2 ||
1802-
phy_types_low & ICE_PHY_TYPE_LOW_50GBASE_KR2 ||
1803-
phy_types_low & ICE_PHY_TYPE_LOW_50GBASE_CP ||
1804-
phy_types_low & ICE_PHY_TYPE_LOW_50GBASE_KR_PAM4) {
1805-
ethtool_link_ksettings_add_link_mode(ks, supported,
1806-
Autoneg);
1807-
ethtool_link_ksettings_add_link_mode(ks, advertising,
1808-
Autoneg);
1809-
}
1810-
if (phy_types_low & ICE_PHY_TYPE_LOW_100GBASE_CR4 ||
1811-
phy_types_low & ICE_PHY_TYPE_LOW_100GBASE_KR4 ||
1812-
phy_types_low & ICE_PHY_TYPE_LOW_100GBASE_KR_PAM4 ||
1813-
phy_types_low & ICE_PHY_TYPE_LOW_100GBASE_CP2) {
1814-
ethtool_link_ksettings_add_link_mode(ks, supported,
1815-
Autoneg);
1816-
ethtool_link_ksettings_add_link_mode(ks, advertising,
1817-
Autoneg);
1818-
}
18191776
}
18201777

18211778
#define TEST_SET_BITS_TIMEOUT 50
@@ -1972,9 +1929,7 @@ ice_get_link_ksettings(struct net_device *netdev,
19721929
ks->base.port = PORT_TP;
19731930
break;
19741931
case ICE_MEDIA_BACKPLANE:
1975-
ethtool_link_ksettings_add_link_mode(ks, supported, Autoneg);
19761932
ethtool_link_ksettings_add_link_mode(ks, supported, Backplane);
1977-
ethtool_link_ksettings_add_link_mode(ks, advertising, Autoneg);
19781933
ethtool_link_ksettings_add_link_mode(ks, advertising,
19791934
Backplane);
19801935
ks->base.port = PORT_NONE;
@@ -2049,6 +2004,12 @@ ice_get_link_ksettings(struct net_device *netdev,
20492004
if (caps->link_fec_options & ICE_AQC_PHY_FEC_25G_RS_CLAUSE91_EN)
20502005
ethtool_link_ksettings_add_link_mode(ks, supported, FEC_RS);
20512006

2007+
/* Set supported and advertised autoneg */
2008+
if (ice_is_phy_caps_an_enabled(caps)) {
2009+
ethtool_link_ksettings_add_link_mode(ks, supported, Autoneg);
2010+
ethtool_link_ksettings_add_link_mode(ks, advertising, Autoneg);
2011+
}
2012+
20522013
done:
20532014
kfree(caps);
20542015
return err;

0 commit comments

Comments
 (0)