linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] mac80211: Give it some time to do the TSF sync
@ 2009-02-21 23:18 Alina Friedrichsen
  2009-02-24  1:40 ` Johannes Berg
  0 siblings, 1 reply; 7+ messages in thread
From: Alina Friedrichsen @ 2009-02-21 23:18 UTC (permalink / raw)
  To: linux-wireless, linville, johannes

Give slow hardware some time to do the TSF sync, to not run into an IBS=
S merging endless loop in some rarely situations.

Version 2 adds a comment.

Version 3: I had forgotten to change the bracket.

diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 1bbfc70..ea737bf 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -332,6 +332,10 @@ static void ieee80211_rx_bss_info(struct ieee80211=
_sub_if_data *sdata,
 	       jiffies);
 #endif
=20
+	/* give slow hardware some time to do the TSF sync */
+	if (rx_timestamp < 0x400000)
+		goto put_bss;
+
 	if (beacon_timestamp > rx_timestamp) {
 #ifdef CONFIG_MAC80211_IBSS_DEBUG
 		printk(KERN_DEBUG "%s: beacon TSF higher than "

--=20
Psssst! Schon vom neuen GMX MultiMessenger geh=F6rt? Der kann`s mit all=
en: http://www.gmx.net/de/go/multimessenger01
--
To unsubscribe from this list: send the line "unsubscribe linux-wireles=
s" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v3] mac80211: Give it some time to do the TSF sync
@ 2009-02-22 17:19 Alina Friedrichsen
  2009-02-23 13:46 ` Kalle Valo
  0 siblings, 1 reply; 7+ messages in thread
From: Alina Friedrichsen @ 2009-02-22 17:19 UTC (permalink / raw)
  To: linux-wireless, linville, johannes

Give slow hardware some time to do the TSF sync, to not run into an IBS=
S merging endless loop in some rarely situations.

Version 2 adds a comment.
Version 3: I had forgotten to change the bracket.
Version 4: No magic number.

Signed-off-by: Alina Friedrichsen <x-alina@gmx.net>
---
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 1bbfc70..367d2cf 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -29,6 +29,7 @@
 #define IEEE80211_IBSS_JOIN_TIMEOUT (7 * HZ)
=20
 #define IEEE80211_IBSS_MERGE_INTERVAL (30 * HZ)
+#define IEEE80211_IBSS_MERGE_DELAY 0x400000
 #define IEEE80211_IBSS_INACTIVITY_LIMIT (60 * HZ)
=20
 #define IEEE80211_IBSS_MAX_STA_ENTRIES 128
@@ -332,6 +333,10 @@ static void ieee80211_rx_bss_info(struct ieee80211=
_sub_if_data *sdata,
 	       jiffies);
 #endif
=20
+	/* give slow hardware some time to do the TSF sync */
+	if (rx_timestamp < IEEE80211_IBSS_MERGE_DELAY)
+		goto put_bss;
+
 	if (beacon_timestamp > rx_timestamp) {
 #ifdef CONFIG_MAC80211_IBSS_DEBUG
 		printk(KERN_DEBUG "%s: beacon TSF higher than "

--=20
Psssst! Schon vom neuen GMX MultiMessenger geh=F6rt? Der kann`s mit all=
en: http://www.gmx.net/de/go/multimessenger01
--
To unsubscribe from this list: send the line "unsubscribe linux-wireles=
s" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v3] mac80211: Give it some time to do the TSF sync
  2009-02-22 17:19 Alina Friedrichsen
@ 2009-02-23 13:46 ` Kalle Valo
  0 siblings, 0 replies; 7+ messages in thread
From: Kalle Valo @ 2009-02-23 13:46 UTC (permalink / raw)
  To: Alina Friedrichsen; +Cc: linux-wireless, linville, johannes

"Alina Friedrichsen" <x-alina@gmx.net> writes:

> Give slow hardware some time to do the TSF sync, to not run into an
> IBSS merging endless loop in some rarely situations.
>
> Version 2 adds a comment.
> Version 3: I had forgotten to change the bracket.
> Version 4: No magic number.

Much better now, thanks. In the future, please write the patch
history...

> Signed-off-by: Alina Friedrichsen <x-alina@gmx.net>
> ---

... to here (ie after the '---' line) so that they are ignored when
the patch applied. This is easier for John.

Reviewed-by: Kalle Valo <kalle.valo@nokia.com>

Disclaimer: I know very little about mac80211 ibss implementation :)

-- 
Kalle Valo

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

* Re: [PATCH v3] mac80211: Give it some time to do the TSF sync
  2009-02-21 23:18 [PATCH v3] mac80211: Give it some time to do the TSF sync Alina Friedrichsen
@ 2009-02-24  1:40 ` Johannes Berg
  2009-02-25  0:49   ` Alina Friedrichsen
  0 siblings, 1 reply; 7+ messages in thread
From: Johannes Berg @ 2009-02-24  1:40 UTC (permalink / raw)
  To: Alina Friedrichsen; +Cc: linux-wireless, linville

[-- Attachment #1: Type: text/plain, Size: 958 bytes --]

On Sun, 2009-02-22 at 00:18 +0100, Alina Friedrichsen wrote:
> Give slow hardware some time to do the TSF sync, to not run into an
> IBSS merging endless loop in some rarely situations.
> 
> Version 2 adds a comment.
> 
> Version 3: I had forgotten to change the bracket.
> 
> diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
> index 1bbfc70..ea737bf 100644
> --- a/net/mac80211/ibss.c
> +++ b/net/mac80211/ibss.c
> @@ -332,6 +332,10 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
>  	       jiffies);
>  #endif
>  
> +	/* give slow hardware some time to do the TSF sync */
> +	if (rx_timestamp < 0x400000)
> +		goto put_bss;

Please elaborate on what this does. This uses the assumption that
reset_tsf() makes it start at 0, and that then the hardware won't sync
up until N seconds etc. I'd like that to be spelt out here, rather than
having to think about this when reading the comment.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH v3] mac80211: Give it some time to do the TSF sync
  2009-02-24  1:40 ` Johannes Berg
@ 2009-02-25  0:49   ` Alina Friedrichsen
  2009-02-25  0:52     ` Alina Friedrichsen
  2009-02-25  1:45     ` Johannes Berg
  0 siblings, 2 replies; 7+ messages in thread
From: Alina Friedrichsen @ 2009-02-25  0:49 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linville, linux-wireless

Hello Johannes!

> Please elaborate on what this does. This uses the assumption that
> reset_tsf() makes it start at 0, and that then the hardware won't syn=
c
> up until N seconds etc.

The ath5k and ath9k drivers do so. If a driver/hardware don't, it cause=
s other problems. For example ("iwconfig wlan0 essid new_ibss") if the =
sync isn't done before the first beacon is send and the TSF of the old =
IBSS-Network was higher the the TSF of the new one, so the all nodes of=
 the new network now sync to the higher TSF of the old network.

Regards
Alina

--=20
Computer Bild Tarifsieger! GMX FreeDSL - Telefonanschluss + DSL
f=FCr nur 17,95 =BF/mtl.!* http://dsl.gmx.de/?ac=3DOM.AD.PD003K11308T45=
69a
--
To unsubscribe from this list: send the line "unsubscribe linux-wireles=
s" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v3] mac80211: Give it some time to do the TSF sync
  2009-02-25  0:49   ` Alina Friedrichsen
@ 2009-02-25  0:52     ` Alina Friedrichsen
  2009-02-25  1:45     ` Johannes Berg
  1 sibling, 0 replies; 7+ messages in thread
From: Alina Friedrichsen @ 2009-02-25  0:52 UTC (permalink / raw)
  To: Alina Friedrichsen, johannes; +Cc: linux-wireless, linville

P.S.: You can test it with:

root@starbuck:~# echo reset > /sys/kernel/debug/ieee80211/phy0/tsf; cat=
 /sys/kernel/debug/ieee80211/phy0/tsf=20
0x0000000000000ca0
root@starbuck:~#=20

--=20
Psssst! Schon vom neuen GMX MultiMessenger geh=F6rt? Der kann`s mit all=
en: http://www.gmx.net/de/go/multimessenger01
--
To unsubscribe from this list: send the line "unsubscribe linux-wireles=
s" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v3] mac80211: Give it some time to do the TSF sync
  2009-02-25  0:49   ` Alina Friedrichsen
  2009-02-25  0:52     ` Alina Friedrichsen
@ 2009-02-25  1:45     ` Johannes Berg
  1 sibling, 0 replies; 7+ messages in thread
From: Johannes Berg @ 2009-02-25  1:45 UTC (permalink / raw)
  To: Alina Friedrichsen; +Cc: linville, linux-wireless

[-- Attachment #1: Type: text/plain, Size: 700 bytes --]

On Wed, 2009-02-25 at 01:49 +0100, Alina Friedrichsen wrote:
> Hello Johannes!
> 
> > Please elaborate on what this does. This uses the assumption that
> > reset_tsf() makes it start at 0, and that then the hardware won't sync
> > up until N seconds etc.
> 
> The ath5k and ath9k drivers do so. If a driver/hardware don't, it
> causes other problems. For example ("iwconfig wlan0 essid new_ibss")
> if the sync isn't done before the first beacon is send and the TSF of
> the old IBSS-Network was higher the the TSF of the new one, so the all
> nodes of the new network now sync to the higher TSF of the old
> network.

Right. I just want to see an explanation in the code.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

end of thread, other threads:[~2009-02-25  3:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-21 23:18 [PATCH v3] mac80211: Give it some time to do the TSF sync Alina Friedrichsen
2009-02-24  1:40 ` Johannes Berg
2009-02-25  0:49   ` Alina Friedrichsen
2009-02-25  0:52     ` Alina Friedrichsen
2009-02-25  1:45     ` Johannes Berg
  -- strict thread matches above, loose matches on Subject: below --
2009-02-22 17:19 Alina Friedrichsen
2009-02-23 13:46 ` Kalle Valo

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).