Re: [PATCH net v2 05/10] net: systemport: Fix RUNT MIB counter register offset calculation

From: netdev-bot+sashiko

Date: Wed Sep 23 2026 - 22:25:12 EST


Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The commit message for "net: systemport: Fix RUNT MIB counter
register offset calculation" says the old code read all 4 RUNT MIB…

--

net: systemport: Fix RUNT MIB counter register offset calculation

This commit changes bcm_sysport_update_mib_counters() so that RUNT MIB
counters are read with an offset of 2 * UMAC_MIB_STAT_OFFSET. This covers
both the RX-to-TX gap and the TX-to-RUNT gap in the UniMAC MIB block.

> In bcm_sysport_update_mib_counters(), 'offset' was only set to
> UMAC_MIB_STAT_OFFSET (0xC) for all non-RX counters, omitting the second
> 0xC gap for BCM_SYSPORT_STAT_RUNT counters. As a result, all 4 RUNT MIB
> counters were read from unmapped gap register space.

[Severity: Low]
Is "all 4 RUNT MIB counters were read from unmapped gap register space"
accurate?

The loop reaches the RUNT entries in bcm_sysport_gstrings_stats after 29
STAT_MIB_RX and 29 STAT_MIB_TX u32 entries, so j is 0xE8 at that point.
With the old offset of 0xC, the four RUNT reads went to:

UMAC_MIB_START + 0xE8 + 0xC = 0x4F4 rx_runt_pkts
UMAC_MIB_START + 0xEC + 0xC = 0x4F8 rx_runt_valid_fcs
UMAC_MIB_START + 0xF0 + 0xC = 0x4FC rx_runt_inval_fcs_align
UMAC_MIB_START + 0xF4 + 0xC = 0x500 rx_runt_bytes

The TX-to-RUNT gap covers only 0x4F4-0x4FF, so only the first three reads
fell in the gap.

The fourth read, for rx_runt_bytes, went to 0x500. That is the real
rx_runt_pkts register. So before this fix, ethtool -S reported the runt
packet count as rx_runt_bytes, not a gap value.

Could the commit message say that three counters read gap space and
rx_runt_bytes showed the rx_runt_pkts value? The code change itself looks
correct and matches the 2 * BCMGENET_STAT_OFFSET handling in bcmgenet.

--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260922232440.598918-1-florian.fainelli%40broadcom.com