Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH] ath9k: Update rate control for better performance at higer rates
@ 2011-09-27 14:54 Rajkumar Manoharan
  2011-09-28 11:38 ` Rajkumar Manoharan
  0 siblings, 1 reply; 2+ messages in thread
From: Rajkumar Manoharan @ 2011-09-27 14:54 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Rajkumar Manoharan

The rate control algorithm is updated as follows in order to improve
the performance at higher rates. Probe the next allowed phy state
only when current rate is max phy and current PER is lower enough.
If the current rate is at max phy and current rate's expected throughput
is lower than next lower rate's expected throughput then drop the rate.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath9k/rc.c |   23 ++++++++++++++++++++---
 1 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
index 8448281..5ee2abe 100644
--- a/drivers/net/wireless/ath/ath9k/rc.c
+++ b/drivers/net/wireless/ath/ath9k/rc.c
@@ -657,11 +657,12 @@ static u8 ath_rc_get_highest_rix(struct ath_softc *sc,
 	rate = best_rate;
 
 	/*
-	 * Must check the actual rate (ratekbps) to account for
-	 * non-monoticity of 11g's rate table
+	 * Probe only when current rate is max phy and current PER
+	 * is lower enough (less or equal to target PER)
 	 */
 
-	if (rate >= ath_rc_priv->rate_max_phy) {
+	if ((rate == ath_rc_priv->rate_max_phy) &&
+	    (ath_rc_priv->per[rate] <= 12)) {
 		rate = ath_rc_priv->rate_max_phy;
 
 		/* Probe the next allowed phy state */
@@ -1085,6 +1086,22 @@ static void ath_rc_update_ht(struct ath_softc *sc,
 		ath_rc_priv->probe_time = now_msec;
 	}
 
+	/*
+	 * When at max allow rate, if current rate expected throuhgput is lower
+	 * then next lower rate expected throughput ,then drop one rate
+	 */
+	if (tx_rate == ath_rc_priv->rate_max_phy) {
+		u8 next_txrate;
+		if (ath_rc_get_lower_rix(rate_table, ath_rc_priv,
+				(u8)tx_rate, &next_txrate)) {
+			if ((rate_table->info[tx_rate].user_ratekbps *
+			     (100 - ath_rc_priv->per[tx_rate])) <
+			    (rate_table->info[next_txrate].user_ratekbps *
+			     (100 - 12)))
+				ath_rc_priv->rate_max_phy = next_txrate;
+		}
+	}
+
 	/* Make sure the rates below this have lower PER */
 	/* Monotonicity is kept only for rates below the current rate. */
 	if (ath_rc_priv->per[tx_rate] < last_per) {
-- 
1.7.6.4


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

end of thread, other threads:[~2011-09-28 13:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-27 14:54 [PATCH] ath9k: Update rate control for better performance at higer rates Rajkumar Manoharan
2011-09-28 11:38 ` Rajkumar Manoharan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox