How to Expose Chip-level Ethernet Statistics?
John Baldwin
jhb at freebsd.org
Mon Aug 6 14:40:01 UTC 2012
On Saturday, August 04, 2012 3:21:23 pm Tim Kientzle wrote:
> I believe that some of the issues I'm having with this
> Ethernet driver might be easier to diagnose if I could
> expose the chip-level statistics counters (especially queue
> overrun counts).
>
> Is there a standard way to do this?
>
> I've looked at systat, netstat, and ifconfig but haven't
> yet found a standard tool that queries this sort of
> information. (If I could find that, I could figure out
> which ioctl it used…)
>
> Pointers appreciated… In particular, if there's another
> Ethernet driver that does this well, I can use that for a
> reference.
Several drivers (igb, em, cxgb, cxgbe, ixgbe, etc.) just expose
a "stats" sysctl node under the device and populate that with
stats. Typically they install a SYSCTL_PROC() that directly
queries the register. In some cases they read the registers
via a timer and cache the results and the sysctl handlers returned
the cached results.
--
John Baldwin
More information about the freebsd-hackers
mailing list