Re: [PATCH net-next 4/5] net/sched: netem: add per-impairment extended statistics
From: Stephen Hemminger
Date: Sat Apr 11 2026 - 01:09:10 EST
On Thu, 9 Apr 2026 11:30:00 +0200
Paolo Abeni <pabeni@xxxxxxxxxx> wrote:
> On 4/4/26 12:52 AM, Stephen Hemminger wrote:
> > diff --git a/include/uapi/linux/pkt_sched.h b/include/uapi/linux/pkt_sched.h
> > index 66e8072f44df..fada10cb9b7b 100644
> > --- a/include/uapi/linux/pkt_sched.h
> > +++ b/include/uapi/linux/pkt_sched.h
> > @@ -569,6 +569,15 @@ struct tc_netem_gemodel {
> > #define NETEM_DIST_SCALE 8192
> > #define NETEM_DIST_MAX 16384
> >
> > +struct tc_netem_xstats {
> > + __u32 delayed; /* packets delayed */
> > + __u32 dropped; /* packets dropped by loss model */
> > + __u32 corrupted; /* packets with bit errors injected */
> > + __u32 duplicated; /* duplicate packets generated */
> > + __u32 reordered; /* packets sent out of order */
> > + __u32 ecn_marked; /* packets ECN CE-marked (not dropped)*/
> > +};
>
> Sashiko notes that the counters size will be set in stone by the uAPI,
> and u32 can wraparound very quickly (especially for unconditional delay).
>
> I see other qdiscs generally use __u32, but some have __u64 too, so I
> assume there are no architectural blocker to larger counter.
>
> Could you please move use __u64 above?
>
> Thanks,
>
> Paolo
>
Sure larger counters are fine, mostly just following the herd.
I assume don't need to need about 32 bit tearing when reading these?