Linux wireless drivers development
 help / color / mirror / Atom feed
From: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
To: <linville@tuxdriver.com>
Cc: <linux-wireless@vger.kernel.org>,
	Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Subject: [PATCH] ath9k: Update rate control for better performance at higer rates
Date: Tue, 27 Sep 2011 20:24:01 +0530	[thread overview]
Message-ID: <1317135241-3523-1-git-send-email-rmanohar@qca.qualcomm.com> (raw)

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


             reply	other threads:[~2011-09-27 14:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-27 14:54 Rajkumar Manoharan [this message]
2011-09-28 11:38 ` [PATCH] ath9k: Update rate control for better performance at higer rates Rajkumar Manoharan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1317135241-3523-1-git-send-email-rmanohar@qca.qualcomm.com \
    --to=rmanohar@qca.qualcomm.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox