Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Sep 2014 19:18:51 -0400
From:      Ryan Stone <rysto32@gmail.com>
To:        freebsd-net <freebsd-net@freebsd.org>
Subject:   [PATCH] Convert ixl(4) and ixlv(4) to ifcounters, and fix some counter bugs
Message-ID:  <CAFMmRNyn0Kjr30Ew%2B8YRRvT-tMFH6WdprAAyJieLz_ABDNK8%2BA@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFMmRNyn0Kjr30Ew%2B8YRRvT-tMFH6WdprAAyJieLz_ABDNK8%2BA>