linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Ben Greear <greearb@candelatech.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH] mac80211: provide race-free 64-bit traffic counters
Date: Mon, 04 Mar 2013 21:15:18 +0100	[thread overview]
Message-ID: <1362428118.21028.45.camel@jlt4.sipsolutions.net> (raw)
In-Reply-To: <5134D604.3060608@candelatech.com>

On Mon, 2013-03-04 at 09:12 -0800, Ben Greear wrote:

[please trim quotes before and after the part you're replying to]

> >   	sinfo->inactive_time = jiffies_to_msecs(jiffies - sta->last_rx);
> > +	sinfo->tx_bytes = 0;
> > +	sinfo->tx_packets = 0;
> > +	for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) {
> > +		sinfo->tx_bytes += sta->tx_bytes[ac];
> > +		sinfo->tx_packets += sta->tx_packets[ac];
> > +	}
> 
> I think you'll need tx_packets to be u64 as well, as otherwise
> if a queue wraps it's going to be quite hard to figure out?

Hmm, that's a good question. I guess I figured it'd never overflow
anyway, but it seems that it is actually possible. I'll change it.

johannes


  reply	other threads:[~2013-03-04 20:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-04 17:02 [PATCH] mac80211: provide race-free 64-bit traffic counters Johannes Berg
2013-03-04 17:12 ` Ben Greear
2013-03-04 20:15   ` Johannes Berg [this message]
2013-03-07 10:24 ` Johannes Berg
2013-03-07 12:55 ` Karl Beldan
2013-03-07 13:04   ` Johannes Berg

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=1362428118.21028.45.camel@jlt4.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=greearb@candelatech.com \
    --cc=linux-wireless@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;
as well as URLs for NNTP newsgroup(s).