Skip to content

Commit 0c7a89e

Browse files
committed
igc: Fix Energy Efficient Ethernet support declaration
Author: Sasha Neftin <sasha.neftin@intel.com> 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 <dima.ruinskiy@intel.com> Signed-off-by: Sasha Neftin <sasha.neftin@intel.com> Tested-by: Naama Meir <naamax.meir@linux.intel.com> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Link: https://lore.kernel.org/r/20240603-net-2024-05-30-intel-net-fixes-v2-6-e3563aa89b0c@intel.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> (cherry picked from commit 7d67d11) JIRA: https://issues.redhat.com/browse/RHEL-17489 Signed-off-by: Corinna Vinschen <vinschen@redhat.com>
1 parent bf9d33c commit 0c7a89e

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

@@ -4875,6 +4876,9 @@ void igc_up(struct igc_adapter *adapter)
48754876
/* start the watchdog. */
48764877
hw->mac.get_link_status = true;
48774878
schedule_work(&adapter->watchdog_task);
4879+
4880+
adapter->eee_advert = MDIO_EEE_100TX | MDIO_EEE_1000T |
4881+
MDIO_EEE_2_5GT;
48784882
}
48794883

48804884
/**

0 commit comments

Comments
 (0)