All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] mac80211: consider only relevant vifs for radar_required calculation
@ 2015-01-04 10:13 Eliad Peller
  2015-01-04 10:13 ` [PATCH 2/3] mac80211: don't defer scans in case of radar detection Eliad Peller
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Eliad Peller @ 2015-01-04 10:13 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

no need to consider all the vifs, but only the ones
that have this context assigned.

Signed-off-by: Eliad Peller <eliad@wizery.com>
---
This patch was already sent previously as part of a different patchset
(in which the other patch was later dropped).
However, i don't see it in patchwork, so resend it.

 net/mac80211/chan.c | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c
index 5d6dae9..7f83451 100644
--- a/net/mac80211/chan.c
+++ b/net/mac80211/chan.c
@@ -388,22 +388,31 @@ ieee80211_find_chanctx(struct ieee80211_local *local,
 	return NULL;
 }
 
-static bool ieee80211_is_radar_required(struct ieee80211_local *local)
+static bool ieee80211_is_radar_required(struct ieee80211_local *local,
+					struct ieee80211_chanctx *ctx)
 {
+	struct ieee80211_chanctx_conf *conf = &ctx->conf;
 	struct ieee80211_sub_if_data *sdata;
+	bool required = false;
 
+	lockdep_assert_held(&local->chanctx_mtx);
 	lockdep_assert_held(&local->mtx);
 
 	rcu_read_lock();
 	list_for_each_entry_rcu(sdata, &local->interfaces, list) {
-		if (sdata->radar_required) {
-			rcu_read_unlock();
-			return true;
-		}
+		if (!ieee80211_sdata_running(sdata))
+			continue;
+		if (rcu_access_pointer(sdata->vif.chanctx_conf) != conf)
+			continue;
+		if (!sdata->radar_required)
+			continue;
+
+		required = true;
+		break;
 	}
 	rcu_read_unlock();
 
-	return false;
+	return required;
 }
 
 static struct ieee80211_chanctx *
@@ -425,7 +434,7 @@ ieee80211_alloc_chanctx(struct ieee80211_local *local,
 	ctx->conf.rx_chains_static = 1;
 	ctx->conf.rx_chains_dynamic = 1;
 	ctx->mode = mode;
-	ctx->conf.radar_enabled = ieee80211_is_radar_required(local);
+	ctx->conf.radar_enabled = ieee80211_is_radar_required(local, ctx);
 	ieee80211_recalc_chanctx_min_def(local, ctx);
 
 	return ctx;
@@ -570,7 +579,7 @@ static void ieee80211_recalc_radar_chanctx(struct ieee80211_local *local,
 	/* for setting local->radar_detect_enabled */
 	lockdep_assert_held(&local->mtx);
 
-	radar_enabled = ieee80211_is_radar_required(local);
+	radar_enabled = ieee80211_is_radar_required(local, chanctx);
 
 	if (radar_enabled == chanctx->conf.radar_enabled)
 		return;
-- 
1.8.5.2.229.g4448466.dirty


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/3] mac80211: don't defer scans in case of radar detection
  2015-01-04 10:13 [PATCH 1/3] mac80211: consider only relevant vifs for radar_required calculation Eliad Peller
@ 2015-01-04 10:13 ` Eliad Peller
  2015-01-04 10:13 ` [PATCH 3/3] mac80211: always recalc_radar on chanctx changes Eliad Peller
  2015-01-06 11:04 ` [PATCH 1/3] mac80211: consider only relevant vifs for radar_required calculation Johannes Berg
  2 siblings, 0 replies; 12+ messages in thread
From: Eliad Peller @ 2015-01-04 10:13 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

Radar detection can last indefinite time. There is no
point in deferring a scan request in this case - simply
return -EBUSY.

Signed-off-by: Eliad Peller <eliad@wizery.com>
---
 net/mac80211/scan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index ae84267..4525623 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -505,7 +505,7 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata,
 
 	lockdep_assert_held(&local->mtx);
 
-	if (local->scan_req)
+	if (local->scan_req || local->radar_detect_enabled)
 		return -EBUSY;
 
 	if (!ieee80211_can_scan(local, sdata)) {
-- 
1.8.5.2.229.g4448466.dirty


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 3/3] mac80211: always recalc_radar on chanctx changes
  2015-01-04 10:13 [PATCH 1/3] mac80211: consider only relevant vifs for radar_required calculation Eliad Peller
  2015-01-04 10:13 ` [PATCH 2/3] mac80211: don't defer scans in case of radar detection Eliad Peller
@ 2015-01-04 10:13 ` Eliad Peller
  2015-01-06 11:04 ` [PATCH 1/3] mac80211: consider only relevant vifs for radar_required calculation Johannes Berg
  2 siblings, 0 replies; 12+ messages in thread
From: Eliad Peller @ 2015-01-04 10:13 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

ieee80211_recalc_radar_chanctx() changes the global
local->radar_detect_enabled in case of a change
from the current chanctx radar_enabled state.

Thus, we need to make sure it will be called
even if the current chanctx is going to be
freed (so local->radar_detect_enabled will
be cleared if needed).

Signed-off-by: Eliad Peller <eliad@wizery.com>
---
 net/mac80211/chan.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c
index 7f83451..9261cc0 100644
--- a/net/mac80211/chan.c
+++ b/net/mac80211/chan.c
@@ -629,10 +629,12 @@ out:
 
 	sdata->vif.bss_conf.idle = !conf;
 
+	if (curr_ctx)
+		ieee80211_recalc_radar_chanctx(local, curr_ctx);
+
 	if (curr_ctx && ieee80211_chanctx_num_assigned(local, curr_ctx) > 0) {
 		ieee80211_recalc_chanctx_chantype(local, curr_ctx);
 		ieee80211_recalc_smps_chanctx(local, curr_ctx);
-		ieee80211_recalc_radar_chanctx(local, curr_ctx);
 		ieee80211_recalc_chanctx_min_def(local, curr_ctx);
 	}
 
-- 
1.8.5.2.229.g4448466.dirty


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/3] mac80211: consider only relevant vifs for radar_required calculation
  2015-01-04 10:13 [PATCH 1/3] mac80211: consider only relevant vifs for radar_required calculation Eliad Peller
  2015-01-04 10:13 ` [PATCH 2/3] mac80211: don't defer scans in case of radar detection Eliad Peller
  2015-01-04 10:13 ` [PATCH 3/3] mac80211: always recalc_radar on chanctx changes Eliad Peller
@ 2015-01-06 11:04 ` Johannes Berg
  2015-01-06 14:05   ` Johannes Berg
  2 siblings, 1 reply; 12+ messages in thread
From: Johannes Berg @ 2015-01-06 11:04 UTC (permalink / raw)
  To: Eliad Peller; +Cc: linux-wireless

all three applied.

johannes


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/3] mac80211: consider only relevant vifs for radar_required calculation
  2015-01-06 11:04 ` [PATCH 1/3] mac80211: consider only relevant vifs for radar_required calculation Johannes Berg
@ 2015-01-06 14:05   ` Johannes Berg
  2015-01-06 14:14     ` Johannes Berg
  0 siblings, 1 reply; 12+ messages in thread
From: Johannes Berg @ 2015-01-06 14:05 UTC (permalink / raw)
  To: Eliad Peller; +Cc: linux-wireless

On Tue, 2015-01-06 at 12:04 +0100, Johannes Berg wrote:
> all three applied.

Nope, dropped patch 2 again - it was causing issues when running the
hwsim tests:

$ ./vm-run.sh dfs ap_ht_40mhz_intolerant_ap
Starting test run in a virtual machine
./run-all.sh: passing the following args to run-tests.py: dfs
ap_ht_40mhz_intolerant_ap 
START dfs 1/2
19
703
PASS dfs 65.148949 2015-01-06 14:02:54.263314
START ap_ht_40mhz_intolerant_ap 2/2
19
719
command failed: Device or resource busy (-16)
Exception: AP startup failed
FAIL ap_ht_40mhz_intolerant_ap 15.53641 2015-01-06 14:03:09.842131
failed tests: ap_ht_40mhz_intolerant_ap

Maybe the tests don't clean up properly, or something, but I'm not going
to investigate this now.

johannes


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/3] mac80211: consider only relevant vifs for radar_required calculation
  2015-01-06 14:05   ` Johannes Berg
@ 2015-01-06 14:14     ` Johannes Berg
  2015-01-06 18:57       ` Eliad Peller
  0 siblings, 1 reply; 12+ messages in thread
From: Johannes Berg @ 2015-01-06 14:14 UTC (permalink / raw)
  To: Eliad Peller; +Cc: linux-wireless

On Tue, 2015-01-06 at 15:05 +0100, Johannes Berg wrote:
> On Tue, 2015-01-06 at 12:04 +0100, Johannes Berg wrote:
> > all three applied.
> 
> Nope, dropped patch 2 again

And dropped the other two also - with them the sequence of two tests I
was looking at never completes.

johannes


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/3] mac80211: consider only relevant vifs for radar_required calculation
  2015-01-06 14:14     ` Johannes Berg
@ 2015-01-06 18:57       ` Eliad Peller
  2015-01-06 19:02         ` Johannes Berg
  0 siblings, 1 reply; 12+ messages in thread
From: Eliad Peller @ 2015-01-06 18:57 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

On Tue, Jan 6, 2015 at 4:14 PM, Johannes Berg <johannes@sipsolutions.net> wrote:
> On Tue, 2015-01-06 at 15:05 +0100, Johannes Berg wrote:
>> On Tue, 2015-01-06 at 12:04 +0100, Johannes Berg wrote:
>> > all three applied.
>>
>> Nope, dropped patch 2 again
>
> And dropped the other two also - with them the sequence of two tests I
> was looking at never completes.
>
err... sorry about that.
i'll look into it.

thanks,
Eliad.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/3] mac80211: consider only relevant vifs for radar_required calculation
  2015-01-06 18:57       ` Eliad Peller
@ 2015-01-06 19:02         ` Johannes Berg
  2015-01-06 19:36           ` Eliad Peller
  0 siblings, 1 reply; 12+ messages in thread
From: Johannes Berg @ 2015-01-06 19:02 UTC (permalink / raw)
  To: Eliad Peller; +Cc: linux-wireless

On Tue, 2015-01-06 at 20:57 +0200, Eliad Peller wrote:
> On Tue, Jan 6, 2015 at 4:14 PM, Johannes Berg <johannes@sipsolutions.net> wrote:
> > On Tue, 2015-01-06 at 15:05 +0100, Johannes Berg wrote:
> >> On Tue, 2015-01-06 at 12:04 +0100, Johannes Berg wrote:
> >> > all three applied.
> >>
> >> Nope, dropped patch 2 again
> >
> > And dropped the other two also - with them the sequence of two tests I
> > was looking at never completes.
> >
> err... sorry about that.
> i'll look into it.

I think there's probably two bugs - the test suite should wait for all
the DFS stuff to finish.

But the fact that it never completes now is strange, maybe somehow radar
detection doesn't get turned off properly after your patches?

johannes


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/3] mac80211: consider only relevant vifs for radar_required calculation
  2015-01-06 19:02         ` Johannes Berg
@ 2015-01-06 19:36           ` Eliad Peller
  2015-01-07 15:58             ` Eliad Peller
  0 siblings, 1 reply; 12+ messages in thread
From: Eliad Peller @ 2015-01-06 19:36 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

On Tue, Jan 6, 2015 at 9:02 PM, Johannes Berg <johannes@sipsolutions.net> wrote:
> On Tue, 2015-01-06 at 20:57 +0200, Eliad Peller wrote:
>> On Tue, Jan 6, 2015 at 4:14 PM, Johannes Berg <johannes@sipsolutions.net> wrote:
>> > On Tue, 2015-01-06 at 15:05 +0100, Johannes Berg wrote:
>> >> On Tue, 2015-01-06 at 12:04 +0100, Johannes Berg wrote:
>> >> > all three applied.
>> >>
>> >> Nope, dropped patch 2 again
>> >
>> > And dropped the other two also - with them the sequence of two tests I
>> > was looking at never completes.
>> >
>> err... sorry about that.
>> i'll look into it.
>
> I think there's probably two bugs - the test suite should wait for all
> the DFS stuff to finish.
>
> But the fact that it never completes now is strange, maybe somehow radar
> detection doesn't get turned off properly after your patches?
>
it's probably local->radar_detect_enabled doesn't get cleared.
patch (3) fixes a similar issue, but there seems to be another one.
(it seems that patch (1) exposed these issues, so i should probably
reorder the patches and make it the last one)

Eliad.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/3] mac80211: consider only relevant vifs for radar_required calculation
  2015-01-06 19:36           ` Eliad Peller
@ 2015-01-07 15:58             ` Eliad Peller
  2015-01-07 16:32               ` Johannes Berg
  0 siblings, 1 reply; 12+ messages in thread
From: Eliad Peller @ 2015-01-07 15:58 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

On Tue, Jan 6, 2015 at 9:36 PM, Eliad Peller <eliad@wizery.com> wrote:
> On Tue, Jan 6, 2015 at 9:02 PM, Johannes Berg <johannes@sipsolutions.net> wrote:
>> On Tue, 2015-01-06 at 20:57 +0200, Eliad Peller wrote:
>>> On Tue, Jan 6, 2015 at 4:14 PM, Johannes Berg <johannes@sipsolutions.net> wrote:
>>> > On Tue, 2015-01-06 at 15:05 +0100, Johannes Berg wrote:
>>> >> On Tue, 2015-01-06 at 12:04 +0100, Johannes Berg wrote:
>>> >> > all three applied.
>>> >>
>>> >> Nope, dropped patch 2 again
>>> >
>>> > And dropped the other two also - with them the sequence of two tests I
>>> > was looking at never completes.
>>> >
>>> err... sorry about that.
>>> i'll look into it.
>>
>> I think there's probably two bugs - the test suite should wait for all
>> the DFS stuff to finish.
>>
>> But the fact that it never completes now is strange, maybe somehow radar
>> detection doesn't get turned off properly after your patches?
>>
> it's probably local->radar_detect_enabled doesn't get cleared.
> patch (3) fixes a similar issue, but there seems to be another one.
> (it seems that patch (1) exposed these issues, so i should probably
> reorder the patches and make it the last one)
>
ok, sent a new patchset.

there were some missing updates of local->radar_detect_enabled, so i
preferred to simply remove it altogether and check for radar detection
directly when needed (i.e. on scan/roc).

ap_ht_40mhz_intolerant_ap still seems to fail here, but it fails even
when running only this test, without any of my patches applied.
now i get the same error with my patches applied ("Exception: AP did
not move to 40 MHz channel") instead of the EBUSY one.

i'll try debugging this issue as well.

Eliad.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/3] mac80211: consider only relevant vifs for radar_required calculation
  2015-01-07 15:58             ` Eliad Peller
@ 2015-01-07 16:32               ` Johannes Berg
  2015-01-07 16:42                 ` Eliad Peller
  0 siblings, 1 reply; 12+ messages in thread
From: Johannes Berg @ 2015-01-07 16:32 UTC (permalink / raw)
  To: Eliad Peller; +Cc: linux-wireless

On Wed, 2015-01-07 at 17:58 +0200, Eliad Peller wrote:

> ok, sent a new patchset.
> 
> there were some missing updates of local->radar_detect_enabled, so i
> preferred to simply remove it altogether and check for radar detection
> directly when needed (i.e. on scan/roc).

Sounds good, thanks.

> ap_ht_40mhz_intolerant_ap still seems to fail here, but it fails even
> when running only this test, without any of my patches applied.
> now i get the same error with my patches applied ("Exception: AP did
> not move to 40 MHz channel") instead of the EBUSY one.
> 
> i'll try debugging this issue as well.

Well, if you want to :)
It's not related to your patches I think, and I saw it passing w/o your
patches applied.

johannes


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/3] mac80211: consider only relevant vifs for radar_required calculation
  2015-01-07 16:32               ` Johannes Berg
@ 2015-01-07 16:42                 ` Eliad Peller
  0 siblings, 0 replies; 12+ messages in thread
From: Eliad Peller @ 2015-01-07 16:42 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

On Wed, Jan 7, 2015 at 6:32 PM, Johannes Berg <johannes@sipsolutions.net> wrote:
> On Wed, 2015-01-07 at 17:58 +0200, Eliad Peller wrote:
>> ap_ht_40mhz_intolerant_ap still seems to fail here, but it fails even
>> when running only this test, without any of my patches applied.
>> now i get the same error with my patches applied ("Exception: AP did
>> not move to 40 MHz channel") instead of the EBUSY one.
>>
>> i'll try debugging this issue as well.
>
> Well, if you want to :)
> It's not related to your patches I think, and I saw it passing w/o your
> patches applied.
>
thanks.
looks like something bad in my setup.
i recompiled hostapd and it seems to pass now :)

Eliad.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-01-07 16:42 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-04 10:13 [PATCH 1/3] mac80211: consider only relevant vifs for radar_required calculation Eliad Peller
2015-01-04 10:13 ` [PATCH 2/3] mac80211: don't defer scans in case of radar detection Eliad Peller
2015-01-04 10:13 ` [PATCH 3/3] mac80211: always recalc_radar on chanctx changes Eliad Peller
2015-01-06 11:04 ` [PATCH 1/3] mac80211: consider only relevant vifs for radar_required calculation Johannes Berg
2015-01-06 14:05   ` Johannes Berg
2015-01-06 14:14     ` Johannes Berg
2015-01-06 18:57       ` Eliad Peller
2015-01-06 19:02         ` Johannes Berg
2015-01-06 19:36           ` Eliad Peller
2015-01-07 15:58             ` Eliad Peller
2015-01-07 16:32               ` Johannes Berg
2015-01-07 16:42                 ` Eliad Peller

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.