All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Aring <alex.aring@gmail.com>
To: Lennert Buytenhek <buytenh@wantstofly.org>
Cc: linux-wpan@vger.kernel.org
Subject: Re: [PATCH 7/8] mac802154: mac802154_header_create() optimisation.
Date: Wed, 20 May 2015 12:33:48 +0200	[thread overview]
Message-ID: <20150520103345.GD3978@omega> (raw)
In-Reply-To: <20150519195018.GS11014@wantstofly.org>

On Tue, May 19, 2015 at 10:50:18PM +0300, Lennert Buytenhek wrote:
> mac802154_header_create() calls ieee802154_mlme_ops(dev)->get_dsn(dev),
> but 'dev' is always a mac802154 device, therefore we can just call
> mac802154_dev_get_dsn() instead directly.
> 

this is correct, but this code has currently more issues. Several days I
posted a draft about to handle the dsn value as atomic_t [0].

This depends on removal of pib and mib lock. The pib lock is a mutex and
mib lock a spinlock currently. See patch [1].

I think I need to explain something about the locking handling:
There exists now a new locking mechanism which protects all pib/mib
values with the rtnl mutex. The mib values are special now, we use them
while frame parsing and generation. For easy handling these values we
hold the rtnl lock and check if the interface is up. If the interface is
up we don't allow changes at mostly mib attributes. This means when a
interface is up we don't need to care about locking, because these
attributes are readonly and in the most hotpath we can remove the locks.

The mib values which are readonly depends "mostly" also on phy
registers, that are some mac operations which doing the phy. These
registers will set when we do a interface up (ndo_do_open). E.g. the
address filter settings, if the phy has the possibilty to set them.

btw: phy settings like channels/cca mode/cca ed level we allow by doing
this while interface up.


Now back to the dsn value, that's a mib setting which is writeable while
ifup and currently we don't have any locks there, but we need locks because
upper layers generates mac headers and they call dev_queue_xmit and this
can be occur at the same time. 


btw:
The dev_hard_header call. (Also at the moment it's ugly to set all parameters
through the skb->cb, we should insert our own dev_hard_dataheader,
dev_hard_beaconheader, dev_hard_cmdheader and have header_ops callbacks in the
wpan_dev structure. To do this over skb->cb will also broke very generic af
families like af_packet, which also call the dev_hard_header without
doing specific 802.15.4 handling inside skb-cb. Then simple let this
pointer to NULL so we don't support this and all 802.15.4 upper layers
call the wpan_dev header creations. Then af_packet will don't call this,
the current behaviour is broken and I believe af_packet works without it.


Sorry, I don't ack this patch. We need to handle this correct with an
atomic_t and we can remove the mib/pib locks because we have a better
locking handling now which follows some strategie.

- Alex

[0] http://www.spinics.net/lists/linux-wpan/msg01920.html
[1] http://www.spinics.net/lists/linux-wpan/msg01896.html

  reply	other threads:[~2015-05-20 10:33 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1432064518.git.buytenh@wantstofly.org>
2015-05-19 19:49 ` [PATCH 1/8] ieee802154 socket: Return EMSGSIZE from raw_sendmsg() if packet too big Lennert Buytenhek
2015-05-20 10:36   ` Alexander Aring
2015-05-19 19:50 ` [PATCH 2/8] Documentation/networking/ieee802154.txt: fix various inaccuracies Lennert Buytenhek
2015-05-19 22:05   ` Marcel Holtmann
2015-05-20  8:36     ` Lennert Buytenhek
2015-05-20  8:40       ` Stefan Schmidt
2015-05-20  8:54       ` Alexander Aring
2015-05-20  9:14         ` Lennert Buytenhek
2015-05-20  9:54       ` Marcel Holtmann
2015-05-20  8:36     ` Stefan Schmidt
2015-05-19 19:50 ` [PATCH 3/8] ieee802154: Remove ieee802154_reduced_mlme_ops references Lennert Buytenhek
2015-05-20 10:34   ` Alexander Aring
2015-05-19 19:50 ` [PATCH 4/8] ieee802154: Remove 802.15.4/6LoWPAN checks for interface MTU Lennert Buytenhek
2015-05-20 10:45   ` Alexander Aring
2015-05-19 19:50 ` [PATCH 5/8] ieee802154 6lowpan: Don't implement ieee802154_mlme_ops Lennert Buytenhek
2015-05-20 10:41   ` Alexander Aring
2015-05-25  6:17     ` Lennert Buytenhek
2015-05-19 19:50 ` [PATCH 6/8] ieee802154 socket: No need to check for ARPHRD_IEEE802154 in raw_bind() Lennert Buytenhek
2015-05-20 10:42   ` Alexander Aring
2015-05-19 19:50 ` [PATCH 7/8] mac802154: mac802154_header_create() optimisation Lennert Buytenhek
2015-05-20 10:33   ` Alexander Aring [this message]
2015-05-19 19:50 ` [PATCH 8/8] mac802154: mac802154_mlme_start_req() optimisation Lennert Buytenhek
2015-05-20 10:11   ` Alexander Aring

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=20150520103345.GD3978@omega \
    --to=alex.aring@gmail.com \
    --cc=buytenh@wantstofly.org \
    --cc=linux-wpan@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.