Linux IEEE 802.15.4 and 6LoWPAN development
 help / color / mirror / Atom feed
From: Alexander Aring <alex.aring@gmail.com>
To: Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de>
Cc: linux-wpan@vger.kernel.org, kernel@pengutronix.de
Subject: Re: [PATCH bluetooth-next 3/3] mac802154: remove mib lock
Date: Tue, 12 May 2015 13:53:02 +0200	[thread overview]
Message-ID: <20150512115258.GF733@omega> (raw)
In-Reply-To: <20150512130615.3f8409f6@zoidberg>

Hi,

...
> > 
> > Introduce a percpu counter for the sequence numbers, incrementation of
> > this counter is an atomic operation then and we are sure that we don't
> > sending the same sequence number when calling this function at the
> > same time.
> 
> With this, two threads running on the same interface can send different
> packets with the same sequence number back to back. Maybe better make
> it atomic instead of percpu instead to avoid that?
> 

Yes you are right, that's not correct. Because per_cpu is a local
variable what's the name said _per_ _cpu_. For this kind of very global
mib value which needs to be incremented after each transmit a atomic_t
should be correct here and that's also what the comment said.

Damn, why I thought that a percpu variable should be correct here.

- Alex

  reply	other threads:[~2015-05-12 11:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-10 20:40 [PATCH bluetooth-next 0/3] mac802154: remove pib/mib locks Alexander Aring
2015-05-10 20:40 ` [PATCH bluetooth-next 1/3] mac802154: fix hold rtnl while ioctl Alexander Aring
2015-05-10 20:40 ` [PATCH bluetooth-next 2/3] mac802154: remove pib lock Alexander Aring
2015-05-10 20:40 ` [PATCH bluetooth-next 3/3] mac802154: remove mib lock Alexander Aring
2015-05-12  7:50   ` Alexander Aring
2015-05-12 11:06     ` Phoebe Buckheister
2015-05-12 11:53       ` Alexander Aring [this message]
2015-05-12 12:22         ` Alexander Aring
2015-05-12 12:25           ` Phoebe Buckheister

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=20150512115258.GF733@omega \
    --to=alex.aring@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-wpan@vger.kernel.org \
    --cc=phoebe.buckheister@itwm.fraunhofer.de \
    /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