Netdev List
 help / color / mirror / Atom feed
From: Chris Wedgwood <cw@f00f.org>
To: Sebastian Cla?en <Sebastian.Classen@freenet-ag.de>
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: overflows in /proc/net/dev
Date: Thu, 18 Aug 2005 09:33:58 -0700	[thread overview]
Message-ID: <20050818163358.GA19554@taniwha.stupidest.org> (raw)
In-Reply-To: <1124350090.29902.8.camel@basti79.freenet-ag.de>

On Thu, Aug 18, 2005 at 09:28:10AM +0200, Sebastian Cla?en wrote:

> in struct net_device_stats all members are defined as unsgined
> long. In time of gigabit ethernet this takes not long to overflow.

It should still take an appreciable amount of time surely?  We can
detect those wraps in userspace and deal with it as needed.

> Are there any plans to change these coutners to unsigned long long?

It comes up from time to time (see below).

> I saw in ifconfig source code the byte and packet counters are
> already defined as unsigned long long.

ifconfig is userspace.


[...]

>  struct net_device_stats
>  {
> -	unsigned long rx_packets;		/* total packets received	*/
> -	unsigned long tx_packets;		/* total packets transmitted	*/
> -	unsigned long rx_bytes;		/* total bytes received 	*/
> -	unsigned long tx_bytes;		/* total bytes transmitted	*/
> +	unsigned long long rx_packets;		/* total packets received	*/
> +	unsigned long long tx_packets;		/* total packets transmitted	*/
> +	unsigned long long rx_bytes;		/* total bytes received 	*/
> +	unsigned long long tx_bytes;		/* total bytes transmitted	*/

I thought the concensurs here was that because doing reliable atomic
updates of 64-bit values isn't possible on some (most?) 32-bit
architectures so we need additional locking to make this work which is
undesirable?  (It might even be a FAQ by now as this comes up fairly
often).

       reply	other threads:[~2005-08-18 16:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1124350090.29902.8.camel@basti79.freenet-ag.de>
2005-08-18 16:33 ` Chris Wedgwood [this message]
2005-08-18 21:32   ` overflows in /proc/net/dev David S. Miller
2005-08-18 22:13     ` Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050818163358.GA19554@taniwha.stupidest.org \
    --to=cw@f00f.org \
    --cc=Sebastian.Classen@freenet-ag.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox