svn commit: r271803 - head/sys/dev/tl
Navdeep Parhar
np at FreeBSD.org
Thu Sep 18 20:59:59 UTC 2014
On 09/18/14 13:50, Gleb Smirnoff wrote:
> Navdeep,
>
> On Thu, Sep 18, 2014 at 01:09:05PM -0700, Navdeep Parhar wrote:
> N> Consider changing if_inc_counter to be inline and have it take const
> N> ints for the counter and increment. The compiler will optimize away all
> N> the unneeded code in if_inc_counter.
>
> Yep, constifying is a good idea.
>
> Regarding the contents of if_inc_counter(). The plan is to remove racy
> counters, make array of counter(9), then if_inc_counter() will get rid
> of switch(), instead it will do:
>
> counter_u64_add(ifp->counters[cnt]);
>
> We can't make it inline, since we want drivers to be not aware of
> struct ifnet entirely.
You can hide ifnet behind a stable KPI or KBI. Looks like your goal is
the latter.
Regards,
Navdeep
More information about the svn-src-head
mailing list