Re: [PATCH net-next v5 1/5] net: cadence: macb: add EEE LPI statistics counters

From: Claudiu Beznea

Date: Sat Feb 28 2026 - 08:35:24 EST




On 2/27/26 17:06, Nicolai Buchwitz wrote:
The GEM MAC provides four read-only, clear-on-read LPI statistics
registers at offsets 0x270-0x27c:

GEM_RXLPI (0x270): RX LPI transition count (16-bit)
GEM_RXLPITIME (0x274): cumulative RX LPI time (24-bit)
GEM_TXLPI (0x278): TX LPI transition count (16-bit)
GEM_TXLPITIME (0x27c): cumulative TX LPI time (24-bit)

Add register offset definitions, extend struct gem_stats with
corresponding u64 software accumulators, and register the four
counters in gem_statistics[] so they appear in ethtool -S output.
Because the hardware counters clear on read, the existing
macb_update_stats() path accumulates them into the u64 fields on
every stats poll, preventing loss between userspace reads.

These registers are present on SAMA5D2, SAME70, PIC32CZ, and RP1
variants of the Cadence GEM IP and have been confirmed on RP1 via
devmem reads.

Reviewed-by: Théo Lebrun<theo.lebrun@xxxxxxxxxxx>
Signed-off-by: Nicolai Buchwitz<nb@xxxxxxxxxxx>

Reviewed-by: Claudiu Beznea <claudiu.beznea@xxxxxxxxx>