Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Sep 2014 16:08:10 +0400
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        Ryan Stone <rysto32@gmail.com>
Cc:        freebsd-net <freebsd-net@freebsd.org>
Subject:   Re: [PATCH] Convert ixl(4) and ixlv(4) to ifcounters, and fix some counter bugs
Message-ID:  <20140925120810.GA884@FreeBSD.org>
In-Reply-To: <CAFMmRNyn0Kjr30Ew%2B8YRRvT-tMFH6WdprAAyJieLz_ABDNK8%2BA@mail.gmail.com>
References:  <CAFMmRNyn0Kjr30Ew%2B8YRRvT-tMFH6WdprAAyJieLz_ABDNK8%2BA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Sep 23, 2014 at 07:18:51PM -0400, Ryan Stone wrote:
R> The patch below converts the ixl(4) and ixlv(4) drivers to use the new
R> ifcounter interface.  I've hidden the interface behind some macros to
R> ensure that the driver continues to compile for FreeBSD 10 and
R> earlier.  The result of the macros is that the ifcounter
R> implementation is somewhat clunkier than I would have liked, but I
R> preferred to try and share as much code between the legacy counter
R> implementation and the ifcounter implementation.
R> 
R> I have tested the ixl driver with head.  I have only compile-tested it
R> for stable/10.
R> 
R> This patch also fixes some counter bugs:
R> 
R> - Ensure that tx discards are reported
R> - There are actually two types of rx discard counters in the hardware.
R> Currently the driver is only reporting discards from one of the two
R> counters, so I fixed that
R> - The ipackets and opackets counters were being unnecessarily
R> incremented in the rx and tx paths.  This was racy, unnecessary (the
R> counters also get explicitly set based on the values in HW counters)
R> and very bad for performance -- the cacheline contained the counters
R> was constantly bouncing between CPUs.  I saw this even with only one
R> queue active, probably due to false sharing with some other field in
R> the ifnet struct.
R> 
R> https://people.freebsd.org/~rstone/patches/ixl/0005-Convert-ixl-and-ixlv-drivers-to-use-new-ifcounter-in.patch

Thanks, Ryan!

I'd suggest to use check against __FreeBSD_version >= 1100036.

Can you please commit this? Navdeep promised to do cxgbe(4), Alexander
is working on ixgbe. After that we can go forward with making counters
in struct ifnet non-racy and cheap counter(9).

-- 
Totus tuus, Glebius.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140925120810.GA884>