linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC v3 0/8] mac80211: jump labels for HW flags
@ 2015-11-11 22:15 Johannes Berg
  2015-11-11 22:15 ` [RFC v3 1/8] mac80211: add ieee80211_hw_clear() Johannes Berg
                   ` (7 more replies)
  0 siblings, 8 replies; 11+ messages in thread
From: Johannes Berg @ 2015-11-11 22:15 UTC (permalink / raw)
  To: linux-wireless; +Cc: Jason Baron, Peter Zijlstra, Steven Rostedt, Michal Marek

Changes since v2:
 * introduce Kconfig count and use it instead of _ON/_OFF in
   the first few patches and described below
   (I'll squash that later if I don't abandon the whole thing)

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] 11+ messages in thread

end of thread, other threads:[~2015-11-12  8:03 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-11 22:15 [RFC v3 0/8] mac80211: jump labels for HW flags Johannes Berg
2015-11-11 22:15 ` [RFC v3 1/8] mac80211: add ieee80211_hw_clear() Johannes Berg
2015-11-11 22:15 ` [RFC v3 2/8] mac80211: introduce ieee80211_local_check() Johannes Berg
2015-11-11 22:15 ` [RFC v3 3/8] mac80211: use static keys for hw flags Johannes Berg
2015-11-11 22:15 ` [RFC v3 4/8] mac80211: test the static key code Johannes Berg
2015-11-11 22:15 ` [RFC v3 5/8] mac80211: generate hw flags from include file Johannes Berg
2015-11-11 22:15 ` [RFC v3 6/8] kconfig: introduce "count" Johannes Berg
2015-11-12  7:59   ` Johannes Berg
2015-11-12  8:03     ` Johannes Berg
2015-11-11 22:15 ` [RFC v3 7/8] kconfig: regenerate the shipped files Johannes Berg
2015-11-11 22:15 ` [RFC v3 8/8] mac80211: use Kconfig counters to determine feature optimisation Johannes Berg

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).