2009-03-10 21:30:12

by Reinette Chatre

[permalink] [raw]
Subject: [PATCH 0/6] iwlwifi HT driver updates

This series includes HT performance improvement changes as well as
debugging infrastructure to support HT.

[PATCH 1/6] iwlwifi: add valid tx antenna information in rate_scale_table debugfs
[PATCH 2/6] iwlwifi: add rf information in rate_scale debugfs command
[PATCH 3/6] iwlwifi: remove un-necessary rs_tl_turn_on_agg() after agg enabled
[PATCH 4/6] iwlwifi: HT performance improvement changes
[PATCH 5/6] iwlwifi: check IEEE80211_TX_STAT_AMPDU for agg pkt
[PATCH 6/6] iwlwifi: verify the antenna selection when receive fixed rate debugfs


Thank you

Reinette



2009-03-10 21:30:13

by Reinette Chatre

[permalink] [raw]
Subject: [PATCH 5/6] iwlwifi: check IEEE80211_TX_STAT_AMPDU for agg pkt

From: Wey-Yi Guy <[email protected]>

when perform rate scaling, in tx status function, checking for
IEEE80211_TX_STAT_AMPDU flag instead of IEEE_TX_CTL_AMPDU flag to perform
AMPDU rate scaling operation.

IEEE80211_TX_CTL_AMPDU was set by mac80211 for aggregation pkt. But when
iwlwifi receive the tx status reply, it reset the flag to following
info->flags = IEEE80211_TX_STAT_ACK;
info->flags |= IEEE80211_TX_STAT_AMPDU;
it causes the rate-scaling to not work for aggregation pkt if we checking
for IEEE80211_TX_CTL_AMPDU flag.

Signed-off-by: Wey-Yi Guy <[email protected]>
Signed-off-by: Reinette Chatre <[email protected]>
---
drivers/net/wireless/iwlwifi/iwl-agn-rs.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
index 0929f31..43c796b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -916,7 +916,7 @@ static void rs_tx_status(void *priv_r, struct ieee80211_supported_band *sband,
tpt = search_tbl->expected_tpt[rs_index];
else
tpt = 0;
- if (info->flags & IEEE80211_TX_CTL_AMPDU)
+ if (info->flags & IEEE80211_TX_STAT_AMPDU)
rs_collect_tx_data(search_win, rs_index, tpt,
info->status.ampdu_ack_len,
info->status.ampdu_ack_map);
@@ -932,7 +932,7 @@ static void rs_tx_status(void *priv_r, struct ieee80211_supported_band *sband,
tpt = curr_tbl->expected_tpt[rs_index];
else
tpt = 0;
- if (info->flags & IEEE80211_TX_CTL_AMPDU)
+ if (info->flags & IEEE80211_TX_STAT_AMPDU)
rs_collect_tx_data(window, rs_index, tpt,
info->status.ampdu_ack_len,
info->status.ampdu_ack_map);
@@ -944,7 +944,7 @@ static void rs_tx_status(void *priv_r, struct ieee80211_supported_band *sband,
/* If not searching for new mode, increment success/failed counter
* ... these help determine when to start searching again */
if (lq_sta->stay_in_tbl) {
- if (info->flags & IEEE80211_TX_CTL_AMPDU) {
+ if (info->flags & IEEE80211_TX_STAT_AMPDU) {
lq_sta->total_success += info->status.ampdu_ack_map;
lq_sta->total_failed +=
(info->status.ampdu_ack_len - info->status.ampdu_ack_map);
--
1.5.6.3


2009-03-10 21:30:13

by Reinette Chatre

[permalink] [raw]
Subject: [PATCH 4/6] iwlwifi: HT performance improvement changes

From: Wey-Yi Guy <[email protected]>

During rate scaling, checking for 0 retry count before decrement
the count by 1, this can avoid the retry count to become 255 (0xff),
which will cause the rate to drop faster than what we expect during good
condition (receive 0 retry packet). also change the algorithm to make
the rate not drop faster than what we like.

Signed-off-by: Wey-Yi Guy <[email protected]>
Signed-off-by: Reinette Chatre <[email protected]>
---
drivers/net/wireless/iwlwifi/iwl-agn-rs.c | 11 ++++++-----
drivers/net/wireless/iwlwifi/iwl-agn-rs.h | 2 +-
2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
index a6f4c74..0929f31 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -801,7 +801,10 @@ static void rs_tx_status(void *priv_r, struct ieee80211_supported_band *sband,
!(info->flags & IEEE80211_TX_STAT_AMPDU))
return;

- retries = info->status.rates[0].count - 1;
+ if (info->flags & IEEE80211_TX_STAT_AMPDU)
+ retries = 0;
+ else
+ retries = info->status.rates[0].count - 1;

if (retries > 15)
retries = 15;
@@ -1897,7 +1900,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
if (high != IWL_RATE_INVALID && sr >= IWL_RATE_INCREASE_TH)
scale_action = 1;
else if (low != IWL_RATE_INVALID)
- scale_action = -1;
+ scale_action = 0;
}

/* Both adjacent throughputs are measured, but neither one has better
@@ -1918,9 +1921,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
sr >= IWL_RATE_INCREASE_TH) {
scale_action = 1;
} else {
- IWL_DEBUG_RATE(priv,
- "decrease rate because of high tpt\n");
- scale_action = -1;
+ scale_action = 0;
}

/* Lower adjacent rate's throughput is measured */
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.h b/drivers/net/wireless/iwlwifi/iwl-agn-rs.h
index 345806d..ab59acc 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.h
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.h
@@ -231,7 +231,7 @@ enum {
#define IWL_RS_GOOD_RATIO 12800 /* 100% */
#define IWL_RATE_SCALE_SWITCH 10880 /* 85% */
#define IWL_RATE_HIGH_TH 10880 /* 85% */
-#define IWL_RATE_INCREASE_TH 8960 /* 70% */
+#define IWL_RATE_INCREASE_TH 6400 /* 50% */
#define IWL_RATE_DECREASE_TH 1920 /* 15% */

/* possible actions when in legacy mode */
--
1.5.6.3


2009-03-10 21:30:12

by Reinette Chatre

[permalink] [raw]
Subject: [PATCH 1/6] iwlwifi: add valid tx antenna information in rate_scale_table debugfs

From: Wey-Yi Guy <[email protected]>

when display rate_scale_table debugfs information, also display valid tx
antenna information, this will help user to select correct antenna when
issue fixed rate debugfs command

Signed-off-by: Wey-Yi Guy <[email protected]>
Acked-by: Ben Cahill <[email protected]>
Signed-off-by: Reinette Chatre <[email protected]>
---
drivers/net/wireless/iwlwifi/iwl-agn-rs.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
index 99da406..039ad57 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -2526,7 +2526,9 @@ static ssize_t rs_sta_dbgfs_scale_table_read(struct file *file,
ssize_t ret;

struct iwl_lq_sta *lq_sta = file->private_data;
+ struct iwl_priv *priv;

+ priv = lq_sta->drv;
buff = kmalloc(1024, GFP_KERNEL);
if (!buff)
return -ENOMEM;
@@ -2537,6 +2539,10 @@ static ssize_t rs_sta_dbgfs_scale_table_read(struct file *file,
lq_sta->active_legacy_rate);
desc += sprintf(buff+desc, "fixed rate 0x%X\n",
lq_sta->dbg_fixed_rate);
+ desc += sprintf(buff+desc, "valid_tx_ant %s%s%s\n",
+ (priv->hw_params.valid_tx_ant & ANT_A) ? "ANT_A," : "",
+ (priv->hw_params.valid_tx_ant & ANT_B) ? "ANT_B," : "",
+ (priv->hw_params.valid_tx_ant & ANT_C) ? "ANT_C" : "");
desc += sprintf(buff+desc, "general:"
"flags=0x%X mimo-d=%d s-ant0x%x d-ant=0x%x\n",
lq_sta->lq.general_params.flags,
--
1.5.6.3


2009-03-10 21:30:13

by Reinette Chatre

[permalink] [raw]
Subject: [PATCH 6/6] iwlwifi: verify the antenna selection when receive fixed rate debugfs

From: Wey-Yi Guy <[email protected]>

When iwlwifi driver receive fixed rate debugfs command, validate the
antenna selection, if the selection is invalid, report the valid antenna
choice and do not set the rate scale table to fixed rate. Otherwise, set
the entire rate scale table to the fixed rate request by the user. this
validation can prevent sysassert happen in uCode

Signed-off-by: Wey-Yi Guy <[email protected]>
Signed-off-by: Reinette Chatre <[email protected]>
---
drivers/net/wireless/iwlwifi/iwl-agn-rs.c | 19 +++++++++++++------
1 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
index 43c796b..cab7842 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -2473,18 +2473,25 @@ static void rs_dbgfs_set_mcs(struct iwl_lq_sta *lq_sta,
u32 *rate_n_flags, int index)
{
struct iwl_priv *priv;
+ u8 valid_tx_ant;
+ u8 ant_sel_tx;

priv = lq_sta->drv;
+ valid_tx_ant = priv->hw_params.valid_tx_ant;
if (lq_sta->dbg_fixed_rate) {
- if (index < 12) {
+ ant_sel_tx =
+ ((lq_sta->dbg_fixed_rate & RATE_MCS_ANT_ABC_MSK)
+ >> RATE_MCS_ANT_POS);
+ if ((valid_tx_ant & ant_sel_tx) == ant_sel_tx) {
*rate_n_flags = lq_sta->dbg_fixed_rate;
+ IWL_DEBUG_RATE(priv, "Fixed rate ON\n");
} else {
- if (lq_sta->band == IEEE80211_BAND_5GHZ)
- *rate_n_flags = 0x800D;
- else
- *rate_n_flags = 0x820A;
+ lq_sta->dbg_fixed_rate = 0;
+ IWL_ERR(priv,
+ "Invalid antenna selection 0x%X, Valid is 0x%X\n",
+ ant_sel_tx, valid_tx_ant);
+ IWL_DEBUG_RATE(priv, "Fixed rate OFF\n");
}
- IWL_DEBUG_RATE(priv, "Fixed rate ON\n");
} else {
IWL_DEBUG_RATE(priv, "Fixed rate OFF\n");
}
--
1.5.6.3


2009-03-10 21:30:13

by Reinette Chatre

[permalink] [raw]
Subject: [PATCH 3/6] iwlwifi: remove un-necessary rs_tl_turn_on_agg() after agg enabled

From: Wey-Yi Guy <[email protected]>

After the MLME handshaking complete and tx aggregation started for the
tid. Do not send unnecessary turn on aggregation request to mac80211.

Signed-off-by: Wey-Yi Guy <[email protected]>
Signed-off-by: Reinette Chatre <[email protected]>
---
drivers/net/wireless/iwlwifi/iwl-agn-rs.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
index 9bcebf2..a6f4c74 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -1700,6 +1700,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
u16 high_low;
s32 sr;
u8 tid = MAX_TID_COUNT;
+ struct iwl_tid_data *tid_data;

IWL_DEBUG_RATE(priv, "rate scale calculate new rate for skb\n");

@@ -2035,8 +2036,15 @@ lq_update:
if ((lq_sta->last_tpt > IWL_AGG_TPT_THREHOLD) &&
(lq_sta->tx_agg_tid_en & (1 << tid)) &&
(tid != MAX_TID_COUNT)) {
- IWL_DEBUG_RATE(priv, "try to aggregate tid %d\n", tid);
- rs_tl_turn_on_agg(priv, tid, lq_sta, sta);
+ tid_data =
+ &priv->stations[lq_sta->lq.sta_id].tid[tid];
+ if (tid_data->agg.state == IWL_AGG_OFF) {
+ IWL_DEBUG_RATE(priv,
+ "try to aggregate tid %d\n",
+ tid);
+ rs_tl_turn_on_agg(priv, tid,
+ lq_sta, sta);
+ }
}
lq_sta->action_counter = 0;
rs_set_stay_in_table(priv, 0, lq_sta);
--
1.5.6.3


2009-03-10 21:30:12

by Reinette Chatre

[permalink] [raw]
Subject: [PATCH 2/6] iwlwifi: add rf information in rate_scale debugfs command

From: Wey-Yi Guy <[email protected]>

Adding more Radio information when displaying
rate_scale_table. This can help to understand how many antenna and the
current RF condition such as SISO, MIMO2, MIMO3.

Signed-off-by: Wey-Yi Guy <[email protected]>
Signed-off-by: Reinette Chatre <[email protected]>
---
drivers/net/wireless/iwlwifi/iwl-agn-rs.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
index 039ad57..9bcebf2 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -2527,6 +2527,7 @@ static ssize_t rs_sta_dbgfs_scale_table_read(struct file *file,

struct iwl_lq_sta *lq_sta = file->private_data;
struct iwl_priv *priv;
+ struct iwl_scale_tbl_info *tbl = &(lq_sta->lq_info[lq_sta->active_tbl]);

priv = lq_sta->drv;
buff = kmalloc(1024, GFP_KERNEL);
@@ -2543,6 +2544,16 @@ static ssize_t rs_sta_dbgfs_scale_table_read(struct file *file,
(priv->hw_params.valid_tx_ant & ANT_A) ? "ANT_A," : "",
(priv->hw_params.valid_tx_ant & ANT_B) ? "ANT_B," : "",
(priv->hw_params.valid_tx_ant & ANT_C) ? "ANT_C" : "");
+ desc += sprintf(buff+desc, "lq type %s\n",
+ (is_legacy(tbl->lq_type)) ? "legacy" : "HT");
+ if (is_Ht(tbl->lq_type)) {
+ desc += sprintf(buff+desc, " %s",
+ (is_siso(tbl->lq_type)) ? "SISO" :
+ ((is_mimo2(tbl->lq_type)) ? "MIMO2" : "MIMO3"));
+ desc += sprintf(buff+desc, " %s",
+ (tbl->is_fat) ? "40MHz" : "20MHz");
+ desc += sprintf(buff+desc, " %s\n", (tbl->is_SGI) ? "SGI" : "");
+ }
desc += sprintf(buff+desc, "general:"
"flags=0x%X mimo-d=%d s-ant0x%x d-ant=0x%x\n",
lq_sta->lq.general_params.flags,
--
1.5.6.3