Date: Thu, 18 Sep 2014 13:59:55 -0700 From: Navdeep Parhar <np@FreeBSD.org> To: Gleb Smirnoff <glebius@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r271803 - head/sys/dev/tl Message-ID: <541B47CB.3000100@FreeBSD.org> In-Reply-To: <20140918205055.GE884@FreeBSD.org> References: <201409182003.s8IK3kr8033068@svn.freebsd.org> <541B3BE1.7080005@FreeBSD.org> <20140918205055.GE884@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?541B47CB.3000100>