* [RFT 0/3] cfg80211: beacon hint improvements
@ 2012-12-13 20:28 Luis R. Rodriguez
2012-12-13 20:28 ` [RFT 1/3] cfg80211: do not process beacon hints if one is already queued Luis R. Rodriguez
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Luis R. Rodriguez @ 2012-12-13 20:28 UTC (permalink / raw)
To: johannes, greearb; +Cc: linux-wireless, Luis R. Rodriguez
From: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
Just a few improvements for beacon hint processing due to
scheduling considerations and discovered by Ben with a lot of
stations. For details see:
http://article.gmane.org/gmane.linux.kernel.wireless.general/101482
Luis R. Rodriguez (3):
cfg80211: do not process beacon hints if one is already queued
cfg80211: move reg_is_world_roaming()
cfg80211: move world roaming check for beacon hints
net/wireless/reg.c | 48 ++++++++++++++++++++++++++++++++++--------------
1 file changed, 34 insertions(+), 14 deletions(-)
--
1.7.10.4
^ permalink raw reply [flat|nested] 6+ messages in thread
* [RFT 1/3] cfg80211: do not process beacon hints if one is already queued
2012-12-13 20:28 [RFT 0/3] cfg80211: beacon hint improvements Luis R. Rodriguez
@ 2012-12-13 20:28 ` Luis R. Rodriguez
2012-12-13 20:28 ` [RFT 2/3] cfg80211: move reg_is_world_roaming() Luis R. Rodriguez
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Luis R. Rodriguez @ 2012-12-13 20:28 UTC (permalink / raw)
To: johannes, greearb; +Cc: linux-wireless, Luis R. Rodriguez
From: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
Regulatory beacon hints are used to help with world roaming
and as it is right now we learn from a beacon hint processed
on one wiphy to all other wiphys. The processing of beacon
hints however is scheduled and if we have a lot of interfaces
we may hit the case that we'll queue a the same beacon hint
many times until its processed.
To avoid this do a lookup on the queued up beacon hints prior
to adding a new beacon hint. If the beacon hint is removed
from the pending reg beacon hint list then it would be processed
and we'd ensure all wiphys would have learned from it, if its
on the pending reg beacon list we'd now find it prior to it
being processed.
Reported-by: Ben Greear <greearb@candelatech.com>
Reported-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
---
net/wireless/reg.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 6e53089..a2d5a03 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -2051,11 +2051,23 @@ static bool freq_is_chan_12_13_14(u16 freq)
return false;
}
+static bool pending_reg_beacon(struct ieee80211_channel *beacon_chan)
+{
+ struct reg_beacon *pending_beacon;
+
+ list_for_each_entry(pending_beacon, ®_pending_beacons, list)
+ if (beacon_chan->center_freq ==
+ pending_beacon->chan.center_freq)
+ return true;
+ return false;
+}
+
int regulatory_hint_found_beacon(struct wiphy *wiphy,
struct ieee80211_channel *beacon_chan,
gfp_t gfp)
{
struct reg_beacon *reg_beacon;
+ bool processing;
if (likely((beacon_chan->beacon_found ||
(beacon_chan->flags & IEEE80211_CHAN_RADAR) ||
@@ -2063,6 +2075,13 @@ int regulatory_hint_found_beacon(struct wiphy *wiphy,
!freq_is_chan_12_13_14(beacon_chan->center_freq)))))
return 0;
+ spin_lock_bh(®_pending_beacons_lock);
+ processing = pending_reg_beacon(beacon_chan);
+ spin_unlock_bh(®_pending_beacons_lock);
+
+ if (processing)
+ return 0;
+
reg_beacon = kzalloc(sizeof(struct reg_beacon), gfp);
if (!reg_beacon)
return -ENOMEM;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [RFT 2/3] cfg80211: move reg_is_world_roaming()
2012-12-13 20:28 [RFT 0/3] cfg80211: beacon hint improvements Luis R. Rodriguez
2012-12-13 20:28 ` [RFT 1/3] cfg80211: do not process beacon hints if one is already queued Luis R. Rodriguez
@ 2012-12-13 20:28 ` Luis R. Rodriguez
2012-12-13 20:28 ` [RFT 3/3] cfg80211: move world roaming check for beacon hints Luis R. Rodriguez
2012-12-14 18:10 ` [RFT 0/3] cfg80211: beacon hint improvements Ben Greear
3 siblings, 0 replies; 6+ messages in thread
From: Luis R. Rodriguez @ 2012-12-13 20:28 UTC (permalink / raw)
To: johannes, greearb; +Cc: linux-wireless, Luis R. Rodriguez
From: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
This will be used later by other code. This has no
functional change.
Reported-by: Ben Greear <greearb@candelatech.com>
Reported-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
---
net/wireless/reg.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index a2d5a03..f649b5e 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -1042,6 +1042,18 @@ static bool ignore_reg_update(struct wiphy *wiphy,
return false;
}
+static bool reg_is_world_roaming(struct wiphy *wiphy)
+{
+ if (is_world_regdom(cfg80211_regdomain->alpha2) ||
+ (wiphy->regd && is_world_regdom(wiphy->regd->alpha2)))
+ return true;
+ if (last_request &&
+ last_request->initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE &&
+ wiphy->flags & WIPHY_FLAG_CUSTOM_REGULATORY)
+ return true;
+ return false;
+}
+
static void handle_reg_beacon(struct wiphy *wiphy,
unsigned int chan_idx,
struct reg_beacon *reg_beacon)
@@ -1128,18 +1140,6 @@ static void wiphy_update_beacon_reg(struct wiphy *wiphy)
}
}
-static bool reg_is_world_roaming(struct wiphy *wiphy)
-{
- if (is_world_regdom(cfg80211_regdomain->alpha2) ||
- (wiphy->regd && is_world_regdom(wiphy->regd->alpha2)))
- return true;
- if (last_request &&
- last_request->initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE &&
- wiphy->flags & WIPHY_FLAG_CUSTOM_REGULATORY)
- return true;
- return false;
-}
-
/* Reap the advantages of previously found beacons */
static void reg_process_beacons(struct wiphy *wiphy)
{
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [RFT 3/3] cfg80211: move world roaming check for beacon hints
2012-12-13 20:28 [RFT 0/3] cfg80211: beacon hint improvements Luis R. Rodriguez
2012-12-13 20:28 ` [RFT 1/3] cfg80211: do not process beacon hints if one is already queued Luis R. Rodriguez
2012-12-13 20:28 ` [RFT 2/3] cfg80211: move reg_is_world_roaming() Luis R. Rodriguez
@ 2012-12-13 20:28 ` Luis R. Rodriguez
2012-12-13 21:23 ` Ben Greear
2012-12-14 18:10 ` [RFT 0/3] cfg80211: beacon hint improvements Ben Greear
3 siblings, 1 reply; 6+ messages in thread
From: Luis R. Rodriguez @ 2012-12-13 20:28 UTC (permalink / raw)
To: johannes, greearb; +Cc: linux-wireless, Luis R. Rodriguez
From: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
We should not add new beacon hints even if the wiphy
is not world roaming. Without this we were always adding
a beacon hint if not world roaming for every non world
roaming wiphy interface.
Reported-by: Ben Greear <greearb@candelatech.com>
Reported-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
---
net/wireless/reg.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index f649b5e..bdc42d9 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -1076,6 +1076,9 @@ static void handle_reg_beacon(struct wiphy *wiphy,
chan->beacon_found = true;
+ if (!reg_is_world_roaming(wiphy))
+ return;
+
if (wiphy->flags & WIPHY_FLAG_DISABLE_BEACON_HINTS)
return;
@@ -1149,8 +1152,6 @@ static void reg_process_beacons(struct wiphy *wiphy)
*/
if (!last_request)
return;
- if (!reg_is_world_roaming(wiphy))
- return;
wiphy_update_beacon_reg(wiphy);
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [RFT 3/3] cfg80211: move world roaming check for beacon hints
2012-12-13 20:28 ` [RFT 3/3] cfg80211: move world roaming check for beacon hints Luis R. Rodriguez
@ 2012-12-13 21:23 ` Ben Greear
0 siblings, 0 replies; 6+ messages in thread
From: Ben Greear @ 2012-12-13 21:23 UTC (permalink / raw)
To: Luis R. Rodriguez; +Cc: johannes, linux-wireless
On 12/13/2012 12:28 PM, Luis R. Rodriguez wrote:
> From: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
>
> We should not add new beacon hints even if the wiphy
Maybe 'even' shouldn't be there?
I'll add this series to our kernels for testing...
Thanks,
Ben
> is not world roaming. Without this we were always adding
> a beacon hint if not world roaming for every non world
> roaming wiphy interface.
>
> Reported-by: Ben Greear <greearb@candelatech.com>
> Reported-by: Johannes Berg <johannes@sipsolutions.net>
> Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
> ---
> net/wireless/reg.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/net/wireless/reg.c b/net/wireless/reg.c
> index f649b5e..bdc42d9 100644
> --- a/net/wireless/reg.c
> +++ b/net/wireless/reg.c
> @@ -1076,6 +1076,9 @@ static void handle_reg_beacon(struct wiphy *wiphy,
>
> chan->beacon_found = true;
>
> + if (!reg_is_world_roaming(wiphy))
> + return;
> +
> if (wiphy->flags & WIPHY_FLAG_DISABLE_BEACON_HINTS)
> return;
>
> @@ -1149,8 +1152,6 @@ static void reg_process_beacons(struct wiphy *wiphy)
> */
> if (!last_request)
> return;
> - if (!reg_is_world_roaming(wiphy))
> - return;
> wiphy_update_beacon_reg(wiphy);
> }
>
>
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFT 0/3] cfg80211: beacon hint improvements
2012-12-13 20:28 [RFT 0/3] cfg80211: beacon hint improvements Luis R. Rodriguez
` (2 preceding siblings ...)
2012-12-13 20:28 ` [RFT 3/3] cfg80211: move world roaming check for beacon hints Luis R. Rodriguez
@ 2012-12-14 18:10 ` Ben Greear
3 siblings, 0 replies; 6+ messages in thread
From: Ben Greear @ 2012-12-14 18:10 UTC (permalink / raw)
To: Luis R. Rodriguez; +Cc: johannes, linux-wireless
On 12/13/2012 12:28 PM, Luis R. Rodriguez wrote:
> From: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
>
> Just a few improvements for beacon hint processing due to
> scheduling considerations and discovered by Ben with a lot of
> stations. For details see:
I added this and Johannes' station cleanup patches to 3.7 and the
600-station tests are running well so far. I see a few beacon
messages, but no spammage. (I also backed out my rate-limit
patch on the beacon messages, so if they *were* inclined to spam,
I should have seen it).
So:
Tested-by: Ben Greear <greearb@candelatech.com>
Thanks,
Ben
>
> http://article.gmane.org/gmane.linux.kernel.wireless.general/101482
>
> Luis R. Rodriguez (3):
> cfg80211: do not process beacon hints if one is already queued
> cfg80211: move reg_is_world_roaming()
> cfg80211: move world roaming check for beacon hints
>
> net/wireless/reg.c | 48 ++++++++++++++++++++++++++++++++++--------------
> 1 file changed, 34 insertions(+), 14 deletions(-)
>
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-12-14 18:10 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-13 20:28 [RFT 0/3] cfg80211: beacon hint improvements Luis R. Rodriguez
2012-12-13 20:28 ` [RFT 1/3] cfg80211: do not process beacon hints if one is already queued Luis R. Rodriguez
2012-12-13 20:28 ` [RFT 2/3] cfg80211: move reg_is_world_roaming() Luis R. Rodriguez
2012-12-13 20:28 ` [RFT 3/3] cfg80211: move world roaming check for beacon hints Luis R. Rodriguez
2012-12-13 21:23 ` Ben Greear
2012-12-14 18:10 ` [RFT 0/3] cfg80211: beacon hint improvements Ben Greear
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).