Skip to content

Commit e42c97c

Browse files
committed
net: cadence: macb: add EEE LPI statistics counters
Expose the GEM MAC's EEE Low Power Idle hardware counters through ethtool -S: - rx_lpi_transitions: number of RX LPI entry events - rx_lpi_time: cumulative time spent in RX LPI - tx_lpi_transitions: number of TX LPI entry events (TXLPIEN 0->1) - tx_lpi_time: cumulative time in TX LPI These are clear-on-read hardware registers at offsets 0x270-0x27c, automatically collected by the existing gem_statistics read loop. Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
1 parent b1abe9e commit e42c97c

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

  • drivers/net/ethernet/cadence

drivers/net/ethernet/cadence/macb.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,6 +1047,10 @@ struct gem_stats {
10471047
u32 rx_ip_header_checksum_errors;
10481048
u32 rx_tcp_checksum_errors;
10491049
u32 rx_udp_checksum_errors;
1050+
u32 rx_lpi_transitions;
1051+
u32 rx_lpi_time;
1052+
u32 tx_lpi_transitions;
1053+
u32 tx_lpi_time;
10501054
};
10511055

10521056
/* Describes the name and offset of an individual statistic register, as
@@ -1146,6 +1150,10 @@ static const struct gem_statistic gem_statistics[] = {
11461150
GEM_BIT(NDS_RXERR)),
11471151
GEM_STAT_TITLE_BITS(RXUDPCCNT, "rx_udp_checksum_errors",
11481152
GEM_BIT(NDS_RXERR)),
1153+
GEM_STAT_TITLE(RXLPI, "rx_lpi_transitions"),
1154+
GEM_STAT_TITLE(RXLPITIME, "rx_lpi_time"),
1155+
GEM_STAT_TITLE(TXLPI, "tx_lpi_transitions"),
1156+
GEM_STAT_TITLE(TXLPITIME, "tx_lpi_time"),
11491157
};
11501158

11511159
#define GEM_STATS_LEN ARRAY_SIZE(gem_statistics)

0 commit comments

Comments
 (0)