netdev
[Top] [All Lists]

netdev.stats change suggestion

To: <netdev@xxxxxxxxxxx>
Subject: netdev.stats change suggestion
From: Dmitrii Tisnek <dima@xxxxxxxxx>
Date: Wed, 23 Jan 2002 15:02:14 +0200 (EET)
Sender: owner-netdev@xxxxxxxxxxx
hey,

I've discovered that struct net_device_stats defines counters like
rx_bytes and tx_bytes as unsigned long, which on x86 is, sadly, 32 bits.

I think that stats are there to be useful, and if so, 4GB limit is cannot
be justified, esp when we have 64-bit file offset support ;-), and yes,
a 32-bit counter does wrap around for me ;-)

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.

(although it seems uint64 is used in some headers, so perhaps it's enough
to use that)

of course other counters in stats structure could be changed too. say
rx_packets is only some 1000 times less than rx_bytes in case of ethernet.

cheers,
dima


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