netdev
[Top] [All Lists]

Re: netdev.stats change suggestion

To: Martin Devera <devik@xxxxxx>
Subject: Re: netdev.stats change suggestion
From: Martin Josefsson <gandalf@xxxxxxxxxxxxxx>
Date: Wed, 23 Jan 2002 17:22:42 +0100 (CET)
Cc: Dmitrii Tisnek <dima@xxxxxxxxx>, netdev@xxxxxxxxxxx
In-reply-to: <Pine.LNX.4.10.10201231405200.15162-100000@xxxxxxxxxxxx>
Sender: owner-netdev@xxxxxxxxxxx
On Wed, 23 Jan 2002, Martin Devera wrote:

> > I understand that some architectures may not support 64-bit types at all
> > (as opposed to natively), so perhaps what needs to be done is a data type,
> > like int64_on_platfroms_and_compilers_which_provide_such_otherwise_32.
> 
> I'd like 64bit netstats too. Only note that "long int" is probably
> what you mentioned above. It is 64bit on supported platforms.

the problem with 64bit counters on 32bit systems is that after each
increase of the low 32bits you have to check for an overflow and if one
occured then we should increase the high 32bits.

That is slower then a simple increase of a 32bit counter. And I think
DaveM, ANK, AK doesn't want this in the core networking code.

on a 100Mbit/s network a 32 bit counter overflows in over 320 seconds so
if you check the counter every 5 minutes and compensate if it has
overflown there isn't really a problem but if you have a 1Gbit/s network
on a 32bit machine it will overflow in over just 30 seconds so you have to
check much more often. Or as I recommend if you are going to push the 
limits of 1Git/s interfaces... get a 64bit machine.

/Martin

Never argue with an idiot. They drag you down to their level, then beat you 
with experience.


<Prev in Thread] Current Thread [Next in Thread>