Commit 82127493 authored by Abhijeet Kolekar's avatar Abhijeet Kolekar Committed by John W. Linville

iwl3945: control rate decrease

Control the rate decrease. Do not decrease the rate fast.
Use success_ratio for rate scaling :)
Signed-off-by: default avatarAbhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 1e680233
...@@ -124,7 +124,7 @@ static struct iwl3945_tpt_entry iwl3945_tpt_table_g[] = { ...@@ -124,7 +124,7 @@ static struct iwl3945_tpt_entry iwl3945_tpt_table_g[] = {
#define IWL39_RATE_HIGH_TH 11520 #define IWL39_RATE_HIGH_TH 11520
#define IWL_SUCCESS_UP_TH 8960 #define IWL_SUCCESS_UP_TH 8960
#define IWL_SUCCESS_DOWN_TH 10880 #define IWL_SUCCESS_DOWN_TH 10880
#define IWL_RATE_MIN_FAILURE_TH 8 #define IWL_RATE_MIN_FAILURE_TH 6
#define IWL_RATE_MIN_SUCCESS_TH 8 #define IWL_RATE_MIN_SUCCESS_TH 8
#define IWL_RATE_DECREASE_TH 1920 #define IWL_RATE_DECREASE_TH 1920
#define IWL_RATE_RETRY_TH 15 #define IWL_RATE_RETRY_TH 15
...@@ -488,7 +488,7 @@ static void rs_tx_status(void *priv_rate, struct ieee80211_supported_band *sband ...@@ -488,7 +488,7 @@ static void rs_tx_status(void *priv_rate, struct ieee80211_supported_band *sband
IWL_DEBUG_RATE(priv, "enter\n"); IWL_DEBUG_RATE(priv, "enter\n");
retries = info->status.rates[0].count - 1; retries = info->status.rates[0].count;
/* Sanity Check for retries */ /* Sanity Check for retries */
if (retries > IWL_RATE_RETRY_TH) if (retries > IWL_RATE_RETRY_TH)
retries = IWL_RATE_RETRY_TH; retries = IWL_RATE_RETRY_TH;
...@@ -791,16 +791,15 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta, ...@@ -791,16 +791,15 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta,
if ((window->success_ratio < IWL_RATE_DECREASE_TH) || !current_tpt) { if ((window->success_ratio < IWL_RATE_DECREASE_TH) || !current_tpt) {
IWL_DEBUG_RATE(priv, "decrease rate because of low success_ratio\n"); IWL_DEBUG_RATE(priv, "decrease rate because of low success_ratio\n");
scale_action = -1; scale_action = -1;
/* No throughput measured yet for adjacent rates, /* No throughput measured yet for adjacent rates,
* try increase */ * try increase */
} else if ((low_tpt == IWL_INVALID_VALUE) && } else if ((low_tpt == IWL_INVALID_VALUE) &&
(high_tpt == IWL_INVALID_VALUE)) { (high_tpt == IWL_INVALID_VALUE)) {
if (high != IWL_RATE_INVALID && window->success_counter >= IWL_RATE_INCREASE_TH) if (high != IWL_RATE_INVALID && window->success_ratio >= IWL_RATE_INCREASE_TH)
scale_action = 1; scale_action = 1;
else if (low != IWL_RATE_INVALID) else if (low != IWL_RATE_INVALID)
scale_action = -1; scale_action = 0;
/* Both adjacent throughputs are measured, but neither one has /* Both adjacent throughputs are measured, but neither one has
* better throughput; we're using the best rate, don't change * better throughput; we're using the best rate, don't change
...@@ -826,14 +825,14 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta, ...@@ -826,14 +825,14 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta,
else { else {
IWL_DEBUG_RATE(priv, IWL_DEBUG_RATE(priv,
"decrease rate because of high tpt\n"); "decrease rate because of high tpt\n");
scale_action = -1; scale_action = 0;
} }
} else if (low_tpt != IWL_INVALID_VALUE) { } else if (low_tpt != IWL_INVALID_VALUE) {
if (low_tpt > current_tpt) { if (low_tpt > current_tpt) {
IWL_DEBUG_RATE(priv, IWL_DEBUG_RATE(priv,
"decrease rate because of low tpt\n"); "decrease rate because of low tpt\n");
scale_action = -1; scale_action = -1;
} else if (window->success_counter >= IWL_RATE_INCREASE_TH) { } else if (window->success_ratio >= IWL_RATE_INCREASE_TH) {
/* Lower rate has better /* Lower rate has better
* throughput,decrease rate */ * throughput,decrease rate */
scale_action = 1; scale_action = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment