[PATCH] Convert ixl(4) and ixlv(4) to ifcounters, and fix some counter bugs

Ryan Stone rysto32 at gmail.com
Tue Sep 23 23:18:54 UTC 2014


The patch below converts the ixl(4) and ixlv(4) drivers to use the new
ifcounter interface.  I've hidden the interface behind some macros to
ensure that the driver continues to compile for FreeBSD 10 and
earlier.  The result of the macros is that the ifcounter
implementation is somewhat clunkier than I would have liked, but I
preferred to try and share as much code between the legacy counter
implementation and the ifcounter implementation.

I have tested the ixl driver with head.  I have only compile-tested it
for stable/10.

This patch also fixes some counter bugs:

- Ensure that tx discards are reported
- There are actually two types of rx discard counters in the hardware.
Currently the driver is only reporting discards from one of the two
counters, so I fixed that
- The ipackets and opackets counters were being unnecessarily
incremented in the rx and tx paths.  This was racy, unnecessary (the
counters also get explicitly set based on the values in HW counters)
and very bad for performance -- the cacheline contained the counters
was constantly bouncing between CPUs.  I saw this even with only one
queue active, probably due to false sharing with some other field in
the ifnet struct.

https://people.freebsd.org/~rstone/patches/ixl/0005-Convert-ixl-and-ixlv-drivers-to-use-new-ifcounter-in.patch


More information about the freebsd-net mailing list