Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Jon Mason <jon.mason@myri.com>
Cc: David Miller <davem@davemloft.net>,
	netdev <netdev@vger.kernel.org>,
	Andrew Gallatin <gallatin@myri.com>
Subject: Re: [PATCH] myri10ge: 64bit slice stats
Date: Mon, 20 Jun 2011 20:49:18 +0200	[thread overview]
Message-ID: <1308595758.2658.16.camel@edumazet-laptop> (raw)
In-Reply-To: <20110620184635.GA18577@myri.com>

Le lundi 20 juin 2011 à 13:46 -0500, Jon Mason a écrit :
> There is a potential issue of internal 32bit stats wrapping before
> updating the external 64bit stats, thus leading to incorrect stats.
> Since there is no hardware necessity for these counters to be 32bit,
> change them to be 64bit to avoid this issue.
> 
> Patch suggested by Eric Dumazet.
> 
> Signed-off-by: Jon Mason <mason@myri.com>
> ---
>  drivers/net/myri10ge/myri10ge.c |   12 ++++++------
>  1 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c
> index 04e10f4..2a51de1 100644
> --- a/drivers/net/myri10ge/myri10ge.c
> +++ b/drivers/net/myri10ge/myri10ge.c
> @@ -170,12 +170,12 @@ struct myri10ge_rx_done {
>  };
>  
>  struct myri10ge_slice_netstats {
> -	unsigned long rx_packets;
> -	unsigned long tx_packets;
> -	unsigned long rx_bytes;
> -	unsigned long tx_bytes;
> -	unsigned long rx_dropped;
> -	unsigned long tx_dropped;
> +	u64 rx_packets;
> +	u64 tx_packets;
> +	u64 rx_bytes;
> +	u64 tx_bytes;
> +	u64 rx_dropped;
> +	u64 tx_dropped;
>  };
>  
>  struct myri10ge_slice_state {

Hmm, no sorry, this wont work on 32bit arches :(

Please take a look at various patches addressing this problem.




  reply	other threads:[~2011-06-20 18:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-20 18:46 [PATCH] myri10ge: 64bit slice stats Jon Mason
2011-06-20 18:49 ` Eric Dumazet [this message]
2011-06-20 18:52   ` Eric Dumazet

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=1308595758.2658.16.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=gallatin@myri.com \
    --cc=jon.mason@myri.com \
    --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