Skip to contentSkip to conversation

mac80211: do not restart ps timer during scan

RFC Superseded Rajkumar Manoharan 3 participants 5 messages Feb 1, 2011

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

RFC 1/1 mac80211: do not restart ps timer during scan

While leaving oper channel, STA informs sleep state to AP to stop sending data. Before sending ack for the nullfunc, AP is still sending the data to STA which restarts ps_timer that is causing unnecessary nullfunc exchange on timer expiry when the STA is on offchannel. So don't restart ps_timer on data reception during scan. This issue was identified by the following warning.

WARNING: at net/mac80211/tx.c:661 invoke_tx_handlers+0xf07/0x1330 [mac80211]
wlan0: Dropped data frame as no usable bitrate found while scanning and
associated. Target station: 00:03:7f:0b:a6:1b on 5 GHz band
Call Trace:
  [<ffffffffa0413ba7>] invoke_tx_handlers+0xf07/0x1330 [mac80211]
  [<ffffffffa0414056>] ieee80211_tx+0x86/0x2c0 [mac80211]
  [<ffffffffa0414345>] ieee80211_xmit+0xb5/0x1d0 [mac80211]
  [<ffffffffa04037e0>] ieee80211_dynamic_ps_enable_work+0x0/0xb0 [mac80211]
  [<ffffffffa04158cf>] ieee80211_tx_skb+0x4f/0x60 [mac80211]
  [<ffffffffa04026e6>] ieee80211_send_nullfunc+0x46/0x60 [mac80211]
  [<ffffffffa0403885>] ieee80211_dynamic_ps_enable_work+0xa5/0xb0 [mac80211]
---
 net/mac80211/rx.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
net/mac80211/rx.c +3 -1
index 7185c93..0e02ce9 100644
@@ -1929,7 +1929,9 @@ ieee80211_rx_h_data(struct ieee80211_rx_data *rx)
 	dev->stats.rx_bytes += rx->skb->len;
 
 	if (local->ps_sdata && local->hw.conf.dynamic_ps_timeout > 0 &&
-	    !is_multicast_ether_addr(((struct ethhdr *)rx->skb->data)->h_dest)) {
+	    !is_multicast_ether_addr(
+		    ((struct ethhdr *)rx->skb->data)->h_dest) &&
+	    !local->scanning) {
 			mod_timer(&local->dynamic_ps_timer, jiffies +
 			 msecs_to_jiffies(local->hw.conf.dynamic_ps_timeout));
 	}
Signature · 1 line
1.7.4
#1 lore raw

PATCH 1/1 ath9k: wakeup hw before stopping beacon queue

Before stopping beacon queue ensure that hw is in AWAKE state. No doing so, causes failure to stop tx dma error message.

---
 drivers/net/wireless/ath/ath9k/main.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/net/wireless/ath/ath9k/main.c +2 -0
index c9925e9..bfc70c1 100644
@@ -1411,6 +1411,7 @@ static void ath9k_do_vif_add_setup(struct ieee80211_hw *hw,
 
 	if (ath9k_uses_beacons(vif->type)) {
 		int error;
+		ath9k_ps_wakeup(sc);
 		ath9k_hw_stoptxdma(sc->sc_ah, sc->beacon.beaconq);
 		/* This may fail because upper levels do not have beacons
 		 * properly configured yet.  That's OK, we assume it
@@ -1423,6 +1424,7 @@ static void ath9k_do_vif_add_setup(struct ieee80211_hw *hw,
 			ath9k_reclaim_beacon(sc, vif);
 		else
 			ath_beacon_config(sc, vif);
+		ath9k_ps_restore(sc);
 	}
 }
 
Signature · 1 line
1.7.4
maintainer
#2 lore raw
In reply to Rajkumar Manoharan
Quoted 30 lines · Rajkumar Manoharan

While leaving oper channel, STA informs sleep state to AP to stop sending data. Before sending ack for the nullfunc, AP is still sending the data to STA which restarts ps_timer that is causing unnecessary nullfunc exchange on timer expiry when the STA is on offchannel. So don't restart ps_timer on data reception during scan. This issue was identified by the following warning.

WARNING: at net/mac80211/tx.c:661 invoke_tx_handlers+0xf07/0x1330 [mac80211]
wlan0: Dropped data frame as no usable bitrate found while scanning and
associated. Target station: 00:03:7f:0b:a6:1b on 5 GHz band
Call Trace:
  [<ffffffffa0413ba7>] invoke_tx_handlers+0xf07/0x1330 [mac80211]
  [<ffffffffa0414056>] ieee80211_tx+0x86/0x2c0 [mac80211]
  [<ffffffffa0414345>] ieee80211_xmit+0xb5/0x1d0 [mac80211]
  [<ffffffffa04037e0>] ieee80211_dynamic_ps_enable_work+0x0/0xb0 [mac80211]
  [<ffffffffa04158cf>] ieee80211_tx_skb+0x4f/0x60 [mac80211]
  [<ffffffffa04026e6>] ieee80211_send_nullfunc+0x46/0x60 [mac80211]
  [<ffffffffa0403885>] ieee80211_dynamic_ps_enable_work+0xa5/0xb0 [mac80211]
---
 net/mac80211/rx.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
net/mac80211/rx.c +0 -0
index 7185c93..0e02ce9 100644

net/mac80211/rx.c ieee80211_rx_h_data(struct ieee80211_rx_data *rx) · line 1934

Quoted 7 lines
net/mac80211/rx.c +3 -1
@@ -1929,7 +1929,9 @@ ieee80211_rx_h_data(struct ieee80211_rx_data *rx)
 	dev->stats.rx_bytes += rx->skb->len;
 
 	if (local->ps_sdata && local->hw.conf.dynamic_ps_timeout > 0 &&
-	    !is_multicast_ether_addr(((struct ethhdr *)rx->skb->data)->h_dest)) {
+	    !is_multicast_ether_addr(
+		    ((struct ethhdr *)rx->skb->data)->h_dest) &&
+	    !local->scanning) {

What if we're off-channel due to other work like P2P?

johannes

#3 lore raw
Quoted 33 lines · Johannes Berg
Quoted 32 lines · Rajkumar Manoharan

While leaving oper channel, STA informs sleep state to AP to stop sending data. Before sending ack for the nullfunc, AP is still sending the data to STA which restarts ps_timer that is causing unnecessary nullfunc exchange on timer expiry when the STA is on offchannel. So don't restart ps_timer on data reception during scan. This issue was identified by the following warning.

WARNING: at net/mac80211/tx.c:661 invoke_tx_handlers+0xf07/0x1330 [mac80211]
wlan0: Dropped data frame as no usable bitrate found while scanning and
associated. Target station: 00:03:7f:0b:a6:1b on 5 GHz band
Call Trace:
   [<ffffffffa0413ba7>] invoke_tx_handlers+0xf07/0x1330 [mac80211]
   [<ffffffffa0414056>] ieee80211_tx+0x86/0x2c0 [mac80211]
   [<ffffffffa0414345>] ieee80211_xmit+0xb5/0x1d0 [mac80211]
   [<ffffffffa04037e0>] ieee80211_dynamic_ps_enable_work+0x0/0xb0 [mac80211]
   [<ffffffffa04158cf>] ieee80211_tx_skb+0x4f/0x60 [mac80211]
   [<ffffffffa04026e6>] ieee80211_send_nullfunc+0x46/0x60 [mac80211]
   [<ffffffffa0403885>] ieee80211_dynamic_ps_enable_work+0xa5/0xb0 [mac80211]
---
  net/mac80211/rx.c |    4 +++-
  1 files changed, 3 insertions(+), 1 deletions(-)
net/mac80211/rx.c +0 -0
index 7185c93..0e02ce9 100644
@@ -1929,7 +1929,9 @@ ieee80211_rx_h_data(struct ieee80211_rx_data *rx)
  	dev->stats.rx_bytes += rx->skb->len;
 
Quoted 7 lines

net/mac80211/rx.c ieee80211_rx_h_data(struct ieee80211_rx_data *rx) · line 1934

Quoted 5 lines
net/mac80211/rx.c +3 -1
  	if (local->ps_sdata&&  local->hw.conf.dynamic_ps_timeout>  0&&
-	    !is_multicast_ether_addr(((struct ethhdr *)rx->skb->data)->h_dest)) {
+	    !is_multicast_ether_addr(
+		    ((struct ethhdr *)rx->skb->data)->h_dest)&&
+	    !local->scanning) {

What if we're off-channel due to other work like P2P?

And, if I can get the scan-on-channel optimization patch in, this check would need to be changed to check for scanning & off-channel instead of just scanning. I have a helper method in my patch to check if we're on the oper-channel....

Thanks,
Ben

Quoted 7 lines

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 2 lines
Ben Greear <[email protected]>
Candela Technologies Inc  http://www.candelatech.com
#4 lore raw
In reply to Johannes Berg
Quoted 33 lines · Johannes Berg
Quoted 32 lines · Rajkumar Manoharan

While leaving oper channel, STA informs sleep state to AP to stop sending data. Before sending ack for the nullfunc, AP is still sending the data to STA which restarts ps_timer that is causing unnecessary nullfunc exchange on timer expiry when the STA is on offchannel. So don't restart ps_timer on data reception during scan. This issue was identified by the following warning.

WARNING: at net/mac80211/tx.c:661 invoke_tx_handlers+0xf07/0x1330 [mac80211]
wlan0: Dropped data frame as no usable bitrate found while scanning and
associated. Target station: 00:03:7f:0b:a6:1b on 5 GHz band
Call Trace:
  [<ffffffffa0413ba7>] invoke_tx_handlers+0xf07/0x1330 [mac80211]
  [<ffffffffa0414056>] ieee80211_tx+0x86/0x2c0 [mac80211]
  [<ffffffffa0414345>] ieee80211_xmit+0xb5/0x1d0 [mac80211]
  [<ffffffffa04037e0>] ieee80211_dynamic_ps_enable_work+0x0/0xb0 [mac80211]
  [<ffffffffa04158cf>] ieee80211_tx_skb+0x4f/0x60 [mac80211]
  [<ffffffffa04026e6>] ieee80211_send_nullfunc+0x46/0x60 [mac80211]
  [<ffffffffa0403885>] ieee80211_dynamic_ps_enable_work+0xa5/0xb0 [mac80211]
---
 net/mac80211/rx.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
net/mac80211/rx.c +0 -0
index 7185c93..0e02ce9 100644
@@ -1929,7 +1929,9 @@ ieee80211_rx_h_data(struct ieee80211_rx_data *rx)
 	dev->stats.rx_bytes += rx->skb->len;
 
Quoted 8 lines

net/mac80211/rx.c ieee80211_rx_h_data(struct ieee80211_rx_data *rx) · line 1934

Quoted 5 lines
net/mac80211/rx.c +3 -1
 	if (local->ps_sdata && local->hw.conf.dynamic_ps_timeout > 0 &&
-	    !is_multicast_ether_addr(((struct ethhdr *)rx->skb->data)->h_dest)) {
+	    !is_multicast_ether_addr(
+		    ((struct ethhdr *)rx->skb->data)->h_dest) &&
+	    !local->scanning) {

What if we're off-channel due to other work like P2P?

Yes. we need to handle offchannel state too. Is it fine to have a check against sdata->state SDATA_STATE_OFFCHANNEL.

--
Rajkumar