linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Luca Coelho <luca@coelho.fi>,
	linux-wireless@vger.kernel.org, Jason Baron <jbaron@akamai.com>,
	Peter Zijlstra <peterz@infradead.org>
Subject: Re: [RFC v2 3/4] mac80211: use static keys for hw flags
Date: Wed, 11 Nov 2015 15:29:02 +0100	[thread overview]
Message-ID: <1447252142.2276.19.camel@sipsolutions.net> (raw)
In-Reply-To: <20151111091859.55f6a4fd@gandalf.local.home>

OnOn Wed, 11 Nov 2015 14:39:16 +0100
> Johannes Berg <johannes@sipsolutions.net> wrote:
> > > On Wed, 2015-11-11 at 08:34 -0500, Steven Rostedt wrote:
> > 
> > > > config MY_DRIVER
> > > > 	depends on MAC80211
> > > > 	increment MAC80211_NUM_DRIVERS
> > > > 	increment MAC80211_HW_MYFLAG  
> > > 
> > > If you don't need to check more that >0 why not just use
> > > SELECT?  
> > 
> > > > if (CONFIG_MAC80211_HW_MYFLAG == 0)
> > > > 	/* optimise for flag OFF */
> > > > else if (CONFIG_MAC80211_HW_MYFLAG > 0 &&
> > > >          CONFIG_MAC80211_NUM_DRIVERS ==
> > > > CONFIG_MAC80211_HW_MYFLAG)
> > > > 	/* optimise for flag ON */
> > > > else if (CONFIG_MAC80211_HW_MYFLAG > 0)
> > > > 	/* don't optimise */  
> > 
> > I'm comparing those numbers to see if there's a driver that's
> > incrementing NUM_DRIVERS but not HW_MYFLAG.
> > 
 Wed, 2015-11-11 at 09:18 -0500, Steven Rostedt wrote:
> 
> OK, I'm still a bit confused. What happens if another driver
> increments
> NUM_DRIVERS? Then the above wont be equal right? That's what you
> want?
> 

Right. Basically it'd be one of three options:
 * all compiled drivers want the flag set:
   use a static key to make the fast case "flag set"
 * no compiled driver wants the flag set:
   use a static key to make the fast case "flag unset"
 * different drivers are compiled:
   don't use a static key since we don't know which one will get used

johannes


  reply	other threads:[~2015-11-11 14:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=1447252142.2276.19.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=jbaron@akamai.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luca@coelho.fi \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.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 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).