]> www.infradead.org Git - users/hch/xfs.git/commitdiff
igc: Fix Energy Efficient Ethernet support declaration
authorSasha Neftin <sasha.neftin@intel.com>
Mon, 3 Jun 2024 21:42:35 +0000 (14:42 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 6 Jun 2024 02:27:56 +0000 (19:27 -0700)
The commit 01cf893bf0f4 ("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: 01cf893bf0f4 ("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>
drivers/net/ethernet/intel/igc/igc_ethtool.c
drivers/net/ethernet/intel/igc/igc_main.c

index f2c4f1966bb041629411c252ca7c7f06b5fdf51e..0cd2bd695db1dfddd64d2c82027f4206b6609268 100644 (file)
@@ -1629,12 +1629,17 @@ static int igc_ethtool_get_eee(struct net_device *netdev,
        struct igc_hw *hw = &adapter->hw;
        u32 eeer;
 
+       linkmode_set_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT,
+                        edata->supported);
+       linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT,
+                        edata->supported);
+       linkmode_set_bit(ETHTOOL_LINK_MODE_100baseT_Full_BIT,
+                        edata->supported);
+
        if (hw->dev_spec._base.eee_enable)
                mii_eee_cap1_mod_linkmode_t(edata->advertised,
                                            adapter->eee_advert);
 
-       *edata = adapter->eee;
-
        eeer = rd32(IGC_EEER);
 
        /* EEE status on negotiated link */
index 12f004f46082cdfdd68493f43ef2e1653b2e815e..305e05294a26595fdc361851e2c75dd9355b9e20 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/bpf_trace.h>
 #include <net/xdp_sock_drv.h>
 #include <linux/pci.h>
+#include <linux/mdio.h>
 
 #include <net/ipv6.h>
 
@@ -4975,6 +4976,9 @@ void igc_up(struct igc_adapter *adapter)
        /* start the watchdog. */
        hw->mac.get_link_status = true;
        schedule_work(&adapter->watchdog_task);
+
+       adapter->eee_advert = MDIO_EEE_100TX | MDIO_EEE_1000T |
+                             MDIO_EEE_2_5GT;
 }
 
 /**