On Thu, Feb 26, 2026 at 09:03:32AM +0200, Ioana Ciornei wrote:
> On Thu, Feb 26, 2026 at 12:38:58AM +0100, Andrew Lunn wrote:
> > On Wed, Feb 25, 2026 at 05:06:48PM +0200, Ioana Ciornei wrote:
> > > Add a new selftest - ethtool_std_stats.sh - which validates the
> > > eth-ctrl, eth-mac and pause standard statistics exported by an
> > > interface. Not all counters can be validated in software, especially
> > > those that are keeping track of errors. Counters such as
> > > SingleCollisionFrames, FrameCheckSequenceErrors etc are not tested nor
> > > included in this new selftest.
> >
> > Hi Ioana
> >
> > Thanks for the test!
> >
> > Do we actually expect errors when running such a test? How many times
> > have you run this test and seen any of the error counters be anything
> > other than 0?
>
> No, we don't expect any errors with this test and I didn't see any error
> counters incremenent in the tens of times that I ran the selftest. But,
> to be fair, I was not looking for them thoroughly through testing.
>
> >
> > Which do you think is more likely:
> >
> > 1) A real error happens
> >
> > 2) Bug in the driver so that it reports a value in the wrong place?
> >
>
> I would say that having a driver bug is much likely than, for example,
> having an FCS error.
>
> > Maybe we should check the error counters are zero?
>
> Ok, I will extend the test to check the errors against zero and see how it
> behaves.
>
I am back with a bit more information. The counters which were not
checked in this version can be grouped in two categories:
- Error counters such as:
u64 FrameCheckSequenceErrors;
u64 AlignmentErrors;
u64 FramesLostDueToIntMACXmitError;
u64 CarrierSenseErrors;
u64 FramesLostDueToIntMACRcvError;
u64 InRangeLengthErrors;
u64 OutOfRangeLengthField;
u64 FrameTooLongErrors;
u64 FramesAbortedDueToXSColls;
I did extend the selftest with these ones so that we check them
against zero. I ran the test hundreds of times and I did not see any
problems.
- Collision related counters (not really errors):
u64 SingleCollisionFrames;
u64 MultipleCollisionFrames;
u64 FramesWithDeferredXmissions;
u64 LateCollisions;
u64 FramesWithExcessiveDeferral;
With these I don't know what to do. Theoretically, they could be
non-zero in half-duplex circumstances which means that checking for
zero would not be entirely accurate.
Ioana