Skip to contentSkip to conversation

Improve software scan timing

RFC In review Helmut Schaa 3 participants 8 messages Feb 23, 2010 mac80211

lore
Share & tools
lore
#0 lore raw

RFC 1/1 Improve software scan timing

The current software scan implemenation in mac80211 returns to the operating channel after each scanned channel. However, in some situations (e.g. no traffic) it would be nicer to scan a few channels in a row to speed up the scan itself.

Hence, after scanning a channel, check if we have queued up any tx frames and return to the operating channel in that case.

Unfortunately we don't know if the AP has buffered any frames for us. Hence, scan only as many channels in a row as the pm_qos latency allows us to.

However I've got a few open questions:

Does anybody know if pm_qos is already used by any applications? At least on my system it seems that nothing sets any latency requirements.

Should we also consider the current listen_interval for deciding how long we could stay away from the operating channel? That should prevent us from losing too many frames but since most drivers don't register a max_listen_interval we usually end up with a listen_interval of 1 which is quite short (which means only scanning one channel in a row).

Kalle, Johannes, how is the listen_interval handled in the powersave code? Are we only sleeping for one beacon interval or are we ignoring the listen_interval currently.

Thanks,
Helmut

---
 net/mac80211/ieee80211_i.h |    1 +
 net/mac80211/scan.c        |   53 +++++++++++++++++++++++++++++++++++++++-----
 2 files changed, 48 insertions(+), 6 deletions(-)
net/mac80211/ieee80211_i.h +1 -0
index 241533e..b841264 100644
@@ -745,6 +745,7 @@ struct ieee80211_local {
 	int scan_channel_idx;
 	int scan_ies_len;
 
+	unsigned long leave_oper_channel_time;
 	enum mac80211_scan_state next_scan_state;
 	struct delayed_work scan_work;
 	struct ieee80211_sub_if_data *scan_sdata;
net/mac80211/scan.c +47 -6

107 lines not on this page · raw message

Signature · 1 line
1.6.0.2
maintainer
#1 lore raw
Quoted 4 lines · Helmut Schaa

However I've got a few open questions:

Does anybody know if pm_qos is already used by any applications? At least on my system it seems that nothing sets any latency requirements.

Yeah, it doesn't seem to be used...

Quoted 8 lines

Should we also consider the current listen_interval for deciding how long
we could stay away from the operating channel? That should prevent us from losing too many frames but since most drivers don't register a max_listen_interval we usually end up with a listen_interval of 1 which is quite short (which means only scanning one channel in a row).

Quoted 4 lines

Kalle, Johannes, how is the listen_interval handled in the powersave code?
Are we only sleeping for one beacon interval or are we ignoring the listen_interval currently.

I figured this listen interval stuff would come back to bite us at some point. I don't think we should negotiate a listen interval of 1. OTOH, I'm not convinced that all APs would reject it with a status code of 51 if it's too large? Or is that tested anywhere like WFA?

In any case, right now the powersave code pretty much ignores it, although that's not really a good plan.

johannes

#2 lore raw

Am Dienstag 23 Februar 2010 schrieb Johannes Berg:

Quoted 14 lines · Helmut Schaa
Quoted 8 lines

Should we also consider the current listen_interval for deciding how long
we could stay away from the operating channel? That should prevent us from losing too many frames but since most drivers don't register a max_listen_interval we usually end up with a listen_interval of 1 which is quite short (which means only scanning one channel in a row).

Quoted 4 lines

Kalle, Johannes, how is the listen_interval handled in the powersave code?
Are we only sleeping for one beacon interval or are we ignoring the listen_interval currently.

Quoted 4 lines

I figured this listen interval stuff would come back to bite us at some point. I don't think we should negotiate a listen interval of 1. OTOH, I'm not convinced that all APs would reject it with a status code of 51 if it's too large? Or is that tested anywhere like WFA?

No idea. However for iwlwifi for example we always used a listen interval of 20 any I never saw any associations getting rejected because of this.

So maybe we could just increase the default to something between 5 and 10 to be on the safe side?

Quoted 2 lines

In any case, right now the powersave code pretty much ignores it, although that's not really a good plan.

Right.

Helmut

maintainer
#3 lore raw
Quoted 15 lines · Helmut Schaa
Quoted 1 line
Quoted 1 line

Kalle, Johannes, how is the listen_interval handled in the

powersave

Quoted 2 lines
Quoted 2 lines

code?
Are we only sleeping for one beacon interval or are we ignoring

the

Quoted 3 lines
Quoted 1 line

listen_interval currently.

I figured this listen interval stuff would come back to bite us at

some

Quoted 1 line

point. I don't think we should negotiate a listen interval of 1.

OTOH,

Quoted 1 line

I'm not convinced that all APs would reject it with a status code of

51

Quoted 1 line

if it's too large? Or is that tested anywhere like WFA?

Quoted 7 lines

No idea. However for iwlwifi for example we always used a listen interval
of 20 any I never saw any associations getting rejected because of this.

So maybe we could just increase the default to something between 5 and 10 to be on the safe side?

Yeah, maybe. Could it be useful for userspace to ask for a specific value with assoc? Though I'm not really sure what it would use ...

johannes

#4 lore raw

Am Dienstag 23 Februar 2010 schrieb Johannes Berg:

Quoted 16 lines · Helmut Schaa
Quoted 15 lines
Quoted 9 lines
Quoted 4 lines

Kalle, Johannes, how is the listen_interval handled in the powersave code?
Are we only sleeping for one beacon interval or are we ignoring the listen_interval currently.

I figured this listen interval stuff would come back to bite us at some point. I don't think we should negotiate a listen interval of 1. OTOH, I'm not convinced that all APs would reject it with a status code of 51 if it's too large? Or is that tested anywhere like WFA?

No idea. However for iwlwifi for example we always used a listen interval
of 20 any I never saw any associations getting rejected because of this.

Quoted 5 lines
Quoted 2 lines

So maybe we could just increase the default to something between 5 and 10 to be on the safe side?

Yeah, maybe. Could it be useful for userspace to ask for a specific value with assoc? Though I'm not really sure what it would use ...

I don't think so. Basically user space only wants to set parameters like pm_qos and if the configured latency allows us to sleep for x ms we should make use of it to improve battery life.

Ok, I'll just update the listen_interval to default to 5 and make use of it in the scan implementation. That should allow us in most cases to leave the channel for around 500ms which is enough time to scan maybe 3-10 channels depending on active/passive flags.

Would that be ok for you?

Helmut

maintainer
#5 lore raw
Quoted 9 lines · Helmut Schaa

Ok, I'll just update the listen_interval to default to 5 and make use of it
in the scan implementation. That should allow us in most cases to leave the
channel for around 500ms which is enough time to scan maybe 3-10 channels
depending on active/passive flags.

Would that be ok for you?

Sure.

(I blame evolution for the stupid formatting of the quote)

johannes

#6 lore raw

Am Dienstag 23 Februar 2010 schrieb Johannes Berg:

Quoted 1 line

(I blame evolution for the stupid formatting of the quote)

I've just switched to Kmail4, so maybe it's not evolution ;)

#7 lore raw
In reply to Johannes Berg
Quoted 8 lines · Johannes Berg
Quoted 4 lines · Helmut Schaa

However I've got a few open questions:

Does anybody know if pm_qos is already used by any applications? At least on my system it seems that nothing sets any latency requirements.

Yeah, it doesn't seem to be used...

Just to be safe, Mark, know of any userspace applications using pm-qos for latency yet?

Luis