All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] mac80211: dynamic PS - don't enter PS when TX frames are pending
@ 2011-06-18 19:32 Arik Nemtsov
  2011-06-19  8:11 ` Johannes Berg
  2011-06-21  4:55 ` Vivek Natarajan
  0 siblings, 2 replies; 10+ messages in thread
From: Arik Nemtsov @ 2011-06-18 19:32 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg, Arik Nemtsov

Use the tx_frames_pending() driver callback to determine if Tx frames are
pending for its internal queues. If so postpone the dynamic PS timeout
to avoid interrupting Tx traffic.

The commit e8306f989483e4b97a8b37dd268de6c8c6f35e75 enabled this
behavior for drivers with IEEE80211_HW_PS_NULLFUNC_STACK. We enable this
for all drivers supporting dynamic PS.

This patch helps improve performance in noisy environments.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
---
 net/mac80211/mlme.c |   22 +++++++++++++---------
 1 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index a41f234..3a1699b 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -758,19 +758,23 @@ void ieee80211_dynamic_ps_enable_work(struct work_struct *work)
 	if (local->hw.conf.flags & IEEE80211_CONF_PS)
 		return;
 
+	/* don't enter PS if dynamic PS is enabled and TX frames are pending */
+	if (local->hw.conf.dynamic_ps_timeout > 0 &&
+	    !local->disable_dynamic_ps && drv_tx_frames_pending(local)) {
+		mod_timer(&local->dynamic_ps_timer, jiffies +
+			  msecs_to_jiffies(
+			  local->hw.conf.dynamic_ps_timeout));
+		return;
+	}
+
 	if ((local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK) &&
 	    (!(ifmgd->flags & IEEE80211_STA_NULLFUNC_ACKED))) {
 		netif_tx_stop_all_queues(sdata->dev);
 
-		if (drv_tx_frames_pending(local))
-			mod_timer(&local->dynamic_ps_timer, jiffies +
-				  msecs_to_jiffies(
-				  local->hw.conf.dynamic_ps_timeout));
-		else {
-			ieee80211_send_nullfunc(local, sdata, 1);
-			/* Flush to get the tx status of nullfunc frame */
-			drv_flush(local, false);
-		}
+		ieee80211_send_nullfunc(local, sdata, 1);
+
+		/* Flush to get the tx status of nullfunc frame */
+		drv_flush(local, false);
 	}
 
 	if (!((local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS) &&
-- 
1.7.4.1


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

end of thread, other threads:[~2011-06-22  8:59 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-18 19:32 [RFC] mac80211: dynamic PS - don't enter PS when TX frames are pending Arik Nemtsov
2011-06-19  8:11 ` Johannes Berg
2011-06-20 13:35   ` John W. Linville
2011-06-20 13:59     ` Johannes Berg
2011-06-20 14:42       ` Kalle Valo
2011-06-20 17:28         ` Sam Leffler
2011-06-21  4:55 ` Vivek Natarajan
2011-06-21  5:43   ` Arik Nemtsov
2011-06-21  6:33     ` Vivek Natarajan
2011-06-22  8:58       ` Arik Nemtsov

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.