Linux wireless drivers development
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Ben Greear <greearb@candelatech.com>
Cc: linux-wireless@vger.kernel.org, qca_vkondrat@qca.qualcomm.com
Subject: Re: [PATCH] mac80211: provide 64-bit traffic counters
Date: Tue, 05 Feb 2013 18:24:46 +0100	[thread overview]
Message-ID: <1360085086.8376.13.camel@jlt4.sipsolutions.net> (raw)
In-Reply-To: <51113F98.8040209@candelatech.com>

On Tue, 2013-02-05 at 09:21 -0800, Ben Greear wrote:
> On 02/05/2013 01:56 AM, Johannes Berg wrote:
> > From: Johannes Berg <johannes.berg@intel.com>
> >
> > "unsigned long" is already 64-bit on (most?) 64-bit
> > machines, use u64 and tell cfg80211 that we provide
> > 64-bit counters now.
> 
>  From what I can tell, these counters are modified using
> += operators.  From what I recall, this is non-atomic on
> 32-bit systems when the variable is u64.
> 
> Is there any other locking that keeps this from blowing up?

Funny you should ask this, we were discussing RX locking in another
thread :-)

In any case, it's *already* non-atomic since incrementing is always a
read-modify-write cycle, and I think that updates can indeed get lost
for the TX counter (and only it) if frames for multiple ACs are
processed at the same time. The proper way to solve that would probably
be having counters for all ACs and summing them only when needed.

johannes


      reply	other threads:[~2013-02-05 17:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-05  9:56 [PATCH] mac80211: provide 64-bit traffic counters Johannes Berg
2013-02-05 17:21 ` Ben Greear
2013-02-05 17:24   ` Johannes Berg [this message]

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=1360085086.8376.13.camel@jlt4.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=greearb@candelatech.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=qca_vkondrat@qca.qualcomm.com \
    /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