[PATCH net-next v4 2/2] net: xilinx: axienet: Add statistics support

Andrew Lunn andrew at lunn.ch
Tue Aug 20 13:23:12 PDT 2024


> > Is that a standard convention to retain/persist counter values across 
> > link up/down?
> 
> IEEE 802.3 section 30.2.1 says
> 
> | All counters defined in this specification are assumed to be
> | wrap-around counters. Wrap-around counters are those that
> | automatically go from their maximum value (or final value) to zero and
> | continue to operate. These unsigned counters do not provide for any
> | explicit means to return them to their minimum (zero), i.e., reset.
> 
> And get_eth_mac_stats implements these counters for Linux. So I would
> say that resetting the counters on link up/down would be non-conformant.
> 
> Other drivers also preserve stats across link up/down. For example,
> MACB/GEM doesn't reset it stats either. And keeping the stats is also
> more friendly for users and monitoring tools.

Agreed.

Some driver get this wrong, and clear them. But as a reviewer, it try
to spot this.

   Andrew



More information about the linux-arm-kernel mailing list