Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Oct 2013 02:52:34 +0200
From:      Luigi Rizzo <rizzo@iet.unipi.it>
To:        Takuya ASADA <syuu@dokukino.com>
Cc:        FreeBSD Net <freebsd-net@freebsd.org>
Subject:   Re: Flow Director statistics for ixgbe(4)
Message-ID:  <CA%2BhQ2%2BhsR%2ByzQ=4yoiQmfu%2BsSVMv7cv-qdCCZFQcBnDnB1GCgw@mail.gmail.com>
In-Reply-To: <CALG4x-W302xOS0P3580UCdJaTDsKq5NiZgcoFBi2jyv9CoQ3%2Bw@mail.gmail.com>
References:  <CALG4x-W302xOS0P3580UCdJaTDsKq5NiZgcoFBi2jyv9CoQ3%2Bw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Wouldn't it be better to make this type of code (sysctl and stat fetching)
table-driven so that it has a smaller footprint in the source (better
readability, less error prone) and binary code ?

One static table could store the various per-counter info
(stat_list offset, sysctl name, REG_NAME, REG_MASK, supported_hw ...)
and then one loop in the add_hw_stats and one in update_stats_counters
does the job.

cheers
luigi



On Mon, Sep 30, 2013 at 9:02 PM, Takuya ASADA <syuu@dokukino.com> wrote:

> Hi,
>
> This is originally part of "ixgbetool" patch, but I think it can be discuss
> separately:
>
> http://freebsd.1045724.n5.nabble.com/Adding-Flow-Director-sysctls-to-ixgbe-4-was-netmap-traffic-distribution-tp5847066p5847789.html
>
> I implemented sysctls to expose Flow Director statistics.
> It works like this:
> $ sysctl dev.ix.0.mac_stats|grep fdir
> dev.ix.0.mac_stats.fdirfree_free: 8192
> dev.ix.0.mac_stats.fdirfree_coll: 0
> dev.ix.0.mac_stats.fdirustat_add: 0
> dev.ix.0.mac_stats.fdirustat_remove: 0
> dev.ix.0.mac_stats.fdirfstat_fadd: 0
> dev.ix.0.mac_stats.fdirfstat_fremove: 0
> dev.ix.0.mac_stats.fdirmatch: 0
> dev.ix.0.mac_stats.fdirmiss: 23
>
> _______________________________________________
> freebsd-net@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"
>



-- 
-----------------------------------------+-------------------------------
 Prof. Luigi RIZZO, rizzo@iet.unipi.it  . Dip. di Ing. dell'Informazione
 http://www.iet.unipi.it/~luigi/        . Universita` di Pisa
 TEL      +39-050-2211611               . via Diotisalvi 2
 Mobile   +39-338-6809875               . 56122 PISA (Italy)
-----------------------------------------+-------------------------------



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2BhQ2%2BhsR%2ByzQ=4yoiQmfu%2BsSVMv7cv-qdCCZFQcBnDnB1GCgw>