]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
if_ffec bugfixes related to harvesting of hardware-maintained statistics...
authorIan Lepore <ian@FreeBSD.org>
Sat, 10 Jun 2017 23:26:25 +0000 (23:26 +0000)
committerIan Lepore <ian@FreeBSD.org>
Sat, 10 Jun 2017 23:26:25 +0000 (23:26 +0000)
commitab3ad5bc81efc2eeccadd440cfcbb14ae1bb0144
tree13fcfbf193d7a5ec4648bf76ffcd663683a9ba76
parent5910b44e7dcecde7795ca0ae6c6fe9a0542d5c66
if_ffec bugfixes related to harvesting of hardware-maintained statistics...

After harvesting the hardware statistics counters and summing them into the
interface stats, properly clear the hardware counters back to zero.  On imx5
and earlier hardware it is necessary to disable collection of stats while
writing zeroes to all the registers.  On imx6 and newer it turns out it's
not even possible to write zeroes, instead you have to toggle a special
"zero everything" control bit in a register.

Count incoming packets with a bad start frame delim as input errors, and
incoming packets dropped due to no fifo space as input drops.

Remove all code related to harvesting the hardware stats less often than
once per second.  It turns out the 32-bit stats registers are backed by
16-bit counters under the hood, and they can easily roll over if you only
harvest them once every 3 seconds like the old code was doing.  Now we just
read all the regs once a second.

The combination of not properly zeroing the stats registers and 16-bit
counters sometimes wrapping between harvest calls resulted in basically
unusable statistics before these changes.
sys/dev/ffec/if_ffec.c