tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Per-cpu stats for network interfaces



Hi,

It's really good to see this being done.

On Mon, Jan 27, 2020 at 05:57:42AM -0800, Jason Thorpe wrote:
 
> > On Jan 27, 2020, at 1:57 AM, Kengo NAKAHARA <k-nakahara%iij.ad.jp@localhost> wrote:

> > It seems "__IF_STATS_PERCPU" is not defined.  "__IF_STATS_PERCPU" is
> > defined when MULTIPROCESSOR is defined, isn't it?
> 
> I have it defined in my local tree, along with a couple of other
> additional change to "struct ifnet" that makes non-converted drivers fail
> to compile.  My plan is for it to become always-on.  However, thinking
> about it a little more, it probably does make sense to conditional-ize it
> somewhat ...  platforms like ARM, x86, sparc, etc.  would define
> __HAVE_NET_STATS_PERCPU in <machine/types.h>, m68k (and sh3, ...) would
> not.  I wouldn't want to continue having "if_data" directly inside "struct
> ifnet", however, so I'll have to think about that part a little more.

I think special casing for things like MULTIPROCESSOR and really old
machines is a bad idea, unless the stakes are very high or it's absolutely
clear cut like "compile this file / don't compile this file and nobody
outside the file can tell the difference".  It's possible I'm simply a bad
programmer but my experience is that special casing this stuff turns out to
be a fine generator of bugs, compile failures and boring maintenance work.

Cheers,
Andrew


Home | Main Index | Thread Index | Old Index