Skip to contentSkip to conversation

igc: Add Energy Efficient Ethernet ability

PATCH In review Sasha Neftin 2 participants 2 messages Jul 13, 2024 – Aug 22, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 igc: Add Energy Efficient Ethernet ability

According to the IEEE standard report the EEE ability (registers 7.60 and 7.62) and the EEE Link Partner ability (registers 7.61 and 7.63). Use the kernel's 'ethtool_keee' structure and report EEE link modes.

Example:
ethtool --show-eee <device>

Before:
Advertised EEE link modes: Not reported
Link partner advertised EEE link modes: Not reported

After:

	Advertised EEE link modes:  100baseT/Full
	                            1000baseT/Full
	                            2500baseT/Full
	Link partner advertised EEE link modes:  100baseT/Full
	                                         1000baseT/Full
	                                         2500baseT/Full
---
 drivers/net/ethernet/intel/igc/igc_defines.h | 10 +++
 drivers/net/ethernet/intel/igc/igc_ethtool.c | 73 +++++++++++++++++++-
 drivers/net/ethernet/intel/igc/igc_regs.h    |  7 ++
 3 files changed, 89 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/igc/igc_defines.h +10 -0
index 58f6631bfdd5..262d0808fed0 100644
@@ -646,6 +646,16 @@
 #define IGC_MDIC_READY		0x10000000
 #define IGC_MDIC_ERROR		0x40000000
 
+/* EEE Link Ability */
+#define IGC_EEE_2500BT_MASK	BIT(0)
+#define IGC_EEE_1000BT_MASK	BIT(2)
+#define IGC_EEE_100BT_MASK	BIT(1)
+
+/* EEE Link-Partner Ability */
+#define IGC_LP_EEE_2500BT_MASK	BIT(0)
+#define IGC_LP_EEE_1000BT_MASK	BIT(2)
+#define IGC_LP_EEE_100BT_MASK	BIT(1)
+
 #define IGC_N0_QUEUE		-1
 
 #define IGC_MAX_MAC_HDR_LEN	127
drivers/net/ethernet/intel/igc/igc_ethtool.c +72 -1

86 lines not on this page · raw message

drivers/net/ethernet/intel/igc/igc_regs.h +7 -0
index c83c723f7c7e..bb6f37f5d3a5 100644
@@ -310,6 +310,13 @@
 #define IGC_IPCNFG	0x0E38 /* Internal PHY Configuration */
 #define IGC_EEE_SU	0x0E34 /* EEE Setup */
 
+/* EEE ANeg Advertisement Register - reg 7.60 and reg 7.62 */
+#define IGC_ANEG_EEE_AB1	0x003c
+#define IGC_ANEG_EEE_AB2	0x003e
+/* EEE ANeg Link-Partner Advertisement Register - reg 7.61 and reg 7.63 */
+#define IGC_ANEG_EEE_LP_AB1	0x003d
+#define IGC_ANEG_EEE_LP_AB2	0x003f
+
 /* LTR registers */
 #define IGC_LTRC	0x01A0 /* Latency Tolerance Reporting Control */
 #define IGC_LTRMINV	0x5BB0 /* LTR Minimum Value */
Signature · 1 line
2.34.1
Tested-by on v1 1/1
#1 lore raw
Quoted 19 lines · Sasha Neftin

According to the IEEE standard report the EEE ability (registers 7.60 and 7.62) and the EEE Link Partner ability (registers 7.61 and 7.63). Use the kernel's 'ethtool_keee' structure and report EEE link modes.

Example:
ethtool --show-eee <device>

Before:
Advertised EEE link modes: Not reported
Link partner advertised EEE link modes: Not reported

After:

	Advertised EEE link modes:  100baseT/Full
	                            1000baseT/Full
	                            2500baseT/Full
	Link partner advertised EEE link modes:  100baseT/Full
	                                         1000baseT/Full
	                                         2500baseT/Full
Quoted 7 lines
---
  drivers/net/ethernet/intel/igc/igc_defines.h | 10 +++
  drivers/net/ethernet/intel/igc/igc_ethtool.c | 73 +++++++++++++++++++-
  drivers/net/ethernet/intel/igc/igc_regs.h    |  7 ++
  3 files changed, 89 insertions(+), 1 deletion(-)