Skip to content

Commit 7d67d11

Browse files
Sasha Neftinkuba-moo
authored andcommitted
igc: Fix Energy Efficient Ethernet support declaration
The commit 01cf893 ("net: intel: i40e/igc: Remove setting Autoneg in EEE capabilities") removed SUPPORTED_Autoneg field but left inappropriate ethtool_keee structure initialization. When "ethtool --show <device>" (get_eee) invoke, the 'ethtool_keee' structure was accidentally overridden. Remove the 'ethtool_keee' overriding and add EEE declaration as per IEEE specification that allows reporting Energy Efficient Ethernet capabilities. Examples: Before fix: ethtool --show-eee enp174s0 EEE settings for enp174s0: EEE status: not supported After fix: EEE settings for enp174s0: EEE status: disabled Tx LPI: disabled Supported EEE link modes: 100baseT/Full 1000baseT/Full 2500baseT/Full Fixes: 01cf893 ("net: intel: i40e/igc: Remove setting Autoneg in EEE capabilities") Suggested-by: Dima Ruinskiy <[email protected]> Signed-off-by: Sasha Neftin <[email protected]> Tested-by: Naama Meir <[email protected]> Signed-off-by: Jacob Keller <[email protected]> Link: https://lore.kernel.org/r/20240603-net-2024-05-30-intel-net-fixes-v2-6-e3563aa89b0c@intel.com Signed-off-by: Jakub Kicinski <[email protected]>
1 parent f3df404 commit 7d67d11

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

drivers/net/ethernet/intel/igc/igc_ethtool.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1629,12 +1629,17 @@ static int igc_ethtool_get_eee(struct net_device *netdev,
16291629
struct igc_hw *hw = &adapter->hw;
16301630
u32 eeer;
16311631

1632+
linkmode_set_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT,
1633+
edata->supported);
1634+
linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT,
1635+
edata->supported);
1636+
linkmode_set_bit(ETHTOOL_LINK_MODE_100baseT_Full_BIT,
1637+
edata->supported);
1638+
16321639
if (hw->dev_spec._base.eee_enable)
16331640
mii_eee_cap1_mod_linkmode_t(edata->advertised,
16341641
adapter->eee_advert);
16351642

1636-
*edata = adapter->eee;
1637-
16381643
eeer = rd32(IGC_EEER);
16391644

16401645
/* EEE status on negotiated link */

drivers/net/ethernet/intel/igc/igc_main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <linux/bpf_trace.h>
1313
#include <net/xdp_sock_drv.h>
1414
#include <linux/pci.h>
15+
#include <linux/mdio.h>
1516

1617
#include <net/ipv6.h>
1718

@@ -4975,6 +4976,9 @@ void igc_up(struct igc_adapter *adapter)
49754976
/* start the watchdog. */
49764977
hw->mac.get_link_status = true;
49774978
schedule_work(&adapter->watchdog_task);
4979+
4980+
adapter->eee_advert = MDIO_EEE_100TX | MDIO_EEE_1000T |
4981+
MDIO_EEE_2_5GT;
49784982
}
49794983

49804984
/**

0 commit comments

Comments
 (0)