All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC v2 0/4] mac80211: jump labels for hw flags
@ 2015-11-10  8:52 Johannes Berg
  2015-11-10  8:52 ` [RFC v2 1/4] mac80211: add ieee80211_hw_clear() Johannes Berg
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Johannes Berg @ 2015-11-10  8:52 UTC (permalink / raw)
  To: linux-wireless; +Cc: Jason Baron, Peter Zijlstra, Steven Rostedt

Changes since v1:
 * use struct static_key_false
 * get rid of all those generated macros and use the optimiser

-----

This was an experiment I thought of on Sunday ...

As also explained in the log for patch 3, we have a lot of behaviour
differences in mac80211 based on which driver we're working against.
In many cases (say OpenWRT router, or a phone/tablet, ChromeBook, etc.)
we only have a single driver built into the system though. In that
case we could - theoretically - elide all the code that isn't required
by that driver, but that seems too dangerous.

Instead, use static keys to set a default for each of the flags. If
the flag is selected as _OFF in Kconfig, then any code that needs it
to be on will be placed out of line and the jump NOPed out; if then
a driver registers that actually needs the code the jump will be put
back and the first thing in the out-of-line section will be to check
the real hw flags.

This pretty much results in the same thing as removing the code/if,
but with more safety.

I haven't done any measurements whatsoever, but I think it might be
something to test on a little MIPS router box.


As far as the code is concerned, there are two really ugly things:
 1) I still use struct static_key - couldn't quite figure it out
    with static_key_false. I think I can replace it easily though.
 2) There are a lot of boilerplate ifdefs/macros.

I can't see a way to avoid more of (2), although I think that we
can probably remove it for a lot of flags and just not have this
ability for those that aren't used in RX/TX/status paths. That'd
probably reduce the code quite a bit.

If anyone has an easy setup to test it on a low-power platform that
would be great.

johannes


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2015-11-11 15:06 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-10  8:52 [RFC v2 0/4] mac80211: jump labels for hw flags Johannes Berg
2015-11-10  8:52 ` [RFC v2 1/4] mac80211: add ieee80211_hw_clear() Johannes Berg
2015-11-10  8:52 ` [RFC v2 2/4] mac80211: introduce ieee80211_local_check() Johannes Berg
2015-11-10  8:52 ` [RFC v2 3/4] mac80211: use static keys for hw flags Johannes Berg
2015-11-11  0:22   ` Luca Coelho
2015-11-11  7:37     ` Johannes Berg
2015-11-11 13:34       ` Steven Rostedt
2015-11-11 13:39         ` Johannes Berg
2015-11-11 14:18           ` Steven Rostedt
2015-11-11 14:29             ` Johannes Berg
2015-11-11 14:45               ` Steven Rostedt
2015-11-11 15:05                 ` Johannes Berg
2015-11-10  8:52 ` [RFC v2 4/4] mac80211: test the static key code Johannes Berg
2015-11-10  9:11 ` [RFC v2 5/4] mac80211: generate hw flags from include file Johannes Berg

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.