linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Ben Greear <greearb@candelatech.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH v4] mac80211:  Optimize sta lookup for many VIFs
Date: Wed, 03 Apr 2013 15:19:50 +0200	[thread overview]
Message-ID: <1364995190.8351.41.camel@jlt4.sipsolutions.net> (raw)
In-Reply-To: <515C2C1F.4000804@candelatech.com>

On Wed, 2013-04-03 at 06:18 -0700, Ben Greear wrote:
> On 04/03/2013 05:58 AM, Johannes Berg wrote:
> > On Fri, 2013-03-29 at 09:00 -0700, greearb@candelatech.com wrote:
> >
> >> --- a/net/mac80211/cfg.c
> >> +++ b/net/mac80211/cfg.c
> >> @@ -1287,6 +1287,7 @@ static int ieee80211_change_station(struct wiphy *wiphy,
> >>   	if (params->vlan && params->vlan != sta->sdata->dev) {
> >>   		bool prev_4addr = false;
> >>   		bool new_4addr = false;
> >> +		struct sta_info *some_sta;
> >>
> >>   		vlansdata = IEEE80211_DEV_TO_SUB_IF(params->vlan);
> >>
> >> @@ -1312,7 +1313,12 @@ static int ieee80211_change_station(struct wiphy *wiphy,
> >>   			prev_4addr = true;
> >>   		}
> >>
> >> +		some_sta = rcu_dereference_protected(sta->sdata->some_sta,
> >> +					lockdep_is_held(&local->sta_mtx));
> >> +		if (some_sta == sta)
> >> +			rcu_assign_pointer(sta->sdata->some_sta, NULL);
> >>   		sta->sdata = vlansdata;
> >> +		rcu_assign_pointer(sta->sdata->some_sta, sta);
> >>
> >>   		if (sta->sta_state == IEEE80211_STA_AUTHORIZED &&
> >>   		    prev_4addr != new_4addr) {
> >
> > I think you can drop all this code since you don't allow this for
> > non-station interfaces, and stations here can only be reassigned between
> > AP/AP_VLAN, no?
> 
> Well, it seems more fragile to skip this code.  If someone ever changes
> how reassignment can happen it may be a while before anyone notices
> the bug.  This code is not in any sort of hot path, so there isn't much
> overhead...

True.

> But, if you still prefer this code removed then I'll make the change.

No, mostly just wondering.

> >> @@ -278,6 +297,8 @@ static void sta_info_hash_add(struct ieee80211_local *local,
> >>   	lockdep_assert_held(&local->sta_mtx);
> >>   	sta->hnext = local->sta_hash[STA_HASH(sta->sta.addr)];
> >>   	rcu_assign_pointer(local->sta_hash[STA_HASH(sta->sta.addr)], sta);
> >> +
> >> +	rcu_assign_pointer(sta->sdata->some_sta, sta);
> >
> > Maybe also assign it only for station to start with?
> 
> That sounds fine, though I doubt it matters any performance wise.

It won't, it's really not used for lookup anyway.

I'll just apply it as is.

johannes


  reply	other threads:[~2013-04-03 13:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-29 16:00 [PATCH v4] mac80211: Optimize sta lookup for many VIFs greearb
2013-04-03 12:58 ` Johannes Berg
2013-04-03 13:18   ` Ben Greear
2013-04-03 13:19     ` Johannes Berg [this message]
2013-04-09  9:50 ` Johannes Berg
2013-04-09 17:35   ` Ben Greear
2013-04-11  9:15     ` Johannes Berg
2013-04-11 16:17       ` Ben Greear

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=1364995190.8351.41.camel@jlt4.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=greearb@candelatech.com \
    --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 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).