All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [iwl-net v1 1/1] igc: Fix Energy Efficient Ethernet support declaration
@ 2024-05-22  7:23 Sasha Neftin
  2024-05-30  8:22 ` naamax.meir
  0 siblings, 1 reply; 2+ messages in thread
From: Sasha Neftin @ 2024-05-22  7:23 UTC (permalink / raw)
  To: intel-wired-lan; +Cc: Sasha Neftin

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>
---
 drivers/net/ethernet/intel/igc/igc_ethtool.c | 9 +++++++--
 drivers/net/ethernet/intel/igc/igc_main.c    | 4 ++++
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c b/drivers/net/ethernet/intel/igc/igc_ethtool.c
index f2c4f1966bb0..0cd2bd695db1 100644
--- a/drivers/net/ethernet/intel/igc/igc_ethtool.c
+++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c
@@ -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 */
diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index b5bcabab7a1d..ba154097d7b0 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -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;
 }
 
 /**
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Intel-wired-lan] [iwl-net v1 1/1] igc: Fix Energy Efficient Ethernet support declaration
  2024-05-22  7:23 [Intel-wired-lan] [iwl-net v1 1/1] igc: Fix Energy Efficient Ethernet support declaration Sasha Neftin
@ 2024-05-30  8:22 ` naamax.meir
  0 siblings, 0 replies; 2+ messages in thread
From: naamax.meir @ 2024-05-30  8:22 UTC (permalink / raw)
  To: Sasha Neftin, intel-wired-lan

On 5/22/2024 10:23, Sasha Neftin wrote:
> 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>
> ---
>   drivers/net/ethernet/intel/igc/igc_ethtool.c | 9 +++++++--
>   drivers/net/ethernet/intel/igc/igc_main.c    | 4 ++++
>   2 files changed, 11 insertions(+), 2 deletions(-)

Tested-by: Naama Meir <naamax.meir@linux.intel.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-05-30  8:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-22  7:23 [Intel-wired-lan] [iwl-net v1 1/1] igc: Fix Energy Efficient Ethernet support declaration Sasha Neftin
2024-05-30  8:22 ` naamax.meir

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.