All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Marek <mmarek@suse.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org, Johannes Berg <johannes.berg@intel.com>
Subject: Re: [RFC v5 4/5] mac80211: use Kconfig counters to elide unnecessary code
Date: Mon, 23 Nov 2015 15:52:44 +0100	[thread overview]
Message-ID: <5653283C.8050207@suse.com> (raw)
In-Reply-To: <1447365652-23716-5-git-send-email-johannes@sipsolutions.net>

On 2015-11-12 23:00, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
> 
> There are many drivers with different behaviour, but in a lot of
> systems only a single driver will ever be built. In that case we
> can get rid of code paths that this driver doesn't need and also
> optimize the ones that it always takes to not have a check.
> 
> To make that possible, make use Kconfig counters to
>  (a) the number of times each feature flag was desired
>  (b) the number of mac80211 drivers built
> and use Kconfig selects to select those flags that any drivers
> need to be dynamic (e.g. if they can only determine this flag's
> setting at runtime.)
> 
> If the dynamic request isn't set then
> 
>  if (a) > 0 then it was requested ON by at least one driver
>  if (a) < (b) then it was requested OFF by at least one driver

So one issue with this logic is that it is not safe to build and use an
out-of-tree mac80211 driver after the kernel has been built. Also, any
new driver needs the 'count MAC80211_NUM_DRIVERS' annotation, but there
is the runtime check to catch omissions. Since this is targeting users
of very specific configs, how about an opt-in scheme à la

- User has to select CONFIG_MAC80211_SINGLE_DRIVER, the help text
  explains the caveats and lists drivers known to work in such mode.
- mac80211 uses the Kconfig-defined constants + dynamic bits iff
  CONFIG_MAC80211_SINGLE_DRIVER=y, otherwise it behaves as before.
- Some build- or compile-time check ensuring that we are not building /
  loading multiple drivers with CONFIG_MAC80211_SINGLE_DRIVER=y.

? It's not very robust either, but at least it would only be used by
those who know what they are doing.

Michal

  parent reply	other threads:[~2015-11-23 14:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-12 22:00 [RFC v5 0/5] mac80211: elide code for static hw flags Johannes Berg
2015-11-12 22:00 ` [RFC v5 1/5] kconfig: introduce "count" Johannes Berg
2015-11-12 22:00 ` [RFC v5 2/5] kconfig: regenerate the shipped files Johannes Berg
2015-11-12 22:00 ` [RFC v5 3/5] mac80211: generate hw flags from include file Johannes Berg
2015-11-12 22:00 ` [RFC v5 4/5] mac80211: use Kconfig counters to elide unnecessary code Johannes Berg
2015-11-13  9:48   ` Julian Calaby
2015-11-13  9:52     ` Johannes Berg
2015-11-13  9:55       ` Johannes Berg
2015-11-20 15:24   ` Michal Marek
2015-11-20 15:29     ` Johannes Berg
2015-11-20 16:37       ` Michal Marek
2015-11-23 14:52   ` Michal Marek [this message]
2015-11-23 14:58     ` Johannes Berg
2015-11-23 15:06       ` Michal Marek
2015-11-23 15:15         ` Johannes Berg
2015-11-12 22:00 ` [RFC v5 5/5] iwlwifi: mvm: add Kconfig settings for hw flags Johannes Berg

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=5653283C.8050207@suse.com \
    --to=mmarek@suse.com \
    --cc=johannes.berg@intel.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@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.