[PATCH net v2] net: airoha: fix MIB stats collection to be lossless

Aniket Negi aniket.negi03 at gmail.com
Wed Jul 1 23:21:47 PDT 2026


> > Signed-off-by: Aniket Negi <aniket.negi03 at gmail.com>
> 
> Hi Aniket,
> 
> just few nits inline. Fixing them:
> 
> Acked-by: Lorenzo Bianconi <lorenzo at kernel.org>
> 

Ok sure. I'll update.

> > +	dev->stats.mib_prev.tx_runt_cnt = val;
> > +
> > +	/* tx_len[0]: RUNT (32-bit, delta) + E64 (64-bit, absolute) → {0, 64} bucket.
> > +	 * Accumulate RUNT delta in tx_runt_accum64, then assign tx_len[0] as
> > +	 * accum + E64_abs so each call gives the correct combined total.
> > +	 */
> 
> no new-line here.
> 
> > +
> > +	dev->stats.tx_len[i] = dev->stats.mib_prev.tx_runt_accum64;
> 

Sure, You are reffering to both the spaces above and below comment section?. Same for rx_runt and rx_long/tx_long.

I'll update as following:
 +	dev->stats.mib_prev.tx_runt_cnt = val;
 +	/* tx_len[0]: RUNT (32-bit, delta) + E64 (64-bit, absolute) → {0, 64} bucket.
 +	 * Accumulate RUNT delta in tx_runt_accum64, then assign tx_len[0] as
 +	 * accum + E64_abs so each call gives the correct combined total.
 +	 */
 +	dev->stats.tx_len[i] = dev->stats.mib_prev.tx_runt_accum64;

> > +		u32 tx_drops;
> > +		u32 tx_broadcast;
> > +		u32 tx_multicast;
> > +		u32 tx_runt_cnt;
> 
> 		u32 tx_runt;
> 
> > +		u32 tx_long_cnt;
> 
> 		u32 tx_long;
> 
> > +		u64 tx_runt_accum64;
> 
> 		64 tx_runt64;
> 
> > +		u32 rx_drops;
> > +		u32 rx_broadcast;
> > +		u32 rx_multicast;
> > +		u32 rx_errors;
> > +		u32 rx_crc_error;
> > +		u32 rx_over_errors;
> > +		u32 rx_fragment;
> > +		u32 rx_jabber;
> > +		u32 rx_runt_cnt;
> 
> 		u32 rx_runt;
> 
> > +		u32 rx_long_cnt;
> 
> 		u32 rx_long;
> 
> > +		u64 rx_runt_accum64;
> 
> 		u64 rx_runt64;
> 
> > +	} mib_prev;
> >  };

Acked the change name from tx_runt_cnt to tx_run, tx_long_cnt to tx_long, tx_runt_accum64 to tx_runt64. Same for rx counters.

Best Regards,
Aniket Negi



More information about the linux-arm-kernel mailing list