Skip to contentSkip to conversation

ath9k: Dont update rate control for every AMPDU

PATCH In review Vasanthakumar Thiagarajan 2 participants 3 messages Nov 20, 2008 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath9k: Dont update rate control for every AMPDU

Update rate control only with the tx status of first AMPDU of an aggregation. This fixes frequent drops in throughput.

---
 drivers/net/wireless/ath9k/rc.c   |    3 ++-
 drivers/net/wireless/ath9k/rc.h   |    1 +
 drivers/net/wireless/ath9k/xmit.c |    2 ++
 3 files changed, 5 insertions(+), 1 deletions(-)
drivers/net/wireless/ath9k/rc.c +2 -1
index e118824..7d1913d 100644
@@ -1413,7 +1413,8 @@ static void ath_tx_status(void *priv, struct ieee80211_supported_band *sband,
 	an = (struct ath_node *)sta->drv_priv;
 	final_ts_idx = tx_info_priv->tx.ts_rateindex;
 
-	if (!an || !priv_sta || !ieee80211_is_data(fc))
+	if (!an || !priv_sta || !ieee80211_is_data(fc) ||
+	    !tx_info_priv->update_rc)
 		goto exit;
 
 	if (tx_info_priv->tx.ts_status & ATH9K_TXERR_FILT)
drivers/net/wireless/ath9k/rc.h +1 -0
index 297dff9..083e006 100644
@@ -188,6 +188,7 @@ struct ath_tx_info_priv {
 	struct ath_tx_status tx;
 	int n_frames;
 	int n_bad_frames;
+	u8 update_rc;
 };
 
 #define ATH_TX_INFO_PRIV(tx_info) \
drivers/net/wireless/ath9k/xmit.c +2 -0
index 50d4105..bea48c3 100644
@@ -950,6 +950,7 @@ static void ath_tx_rc_status(struct ath_buf *bf, struct ath_desc *ds, int nbad)
 	struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
 	struct ath_tx_info_priv *tx_info_priv = ATH_TX_INFO_PRIV(tx_info);
 
+	tx_info_priv->update_rc = 0;
 	if (ds->ds_txstat.ts_status & ATH9K_TXERR_FILT)
 		tx_info->flags |= IEEE80211_TX_STAT_TX_FILTERED;
 
@@ -960,6 +961,7 @@ static void ath_tx_rc_status(struct ath_buf *bf, struct ath_desc *ds, int nbad)
 			       sizeof(tx_info_priv->tx));
 			tx_info_priv->n_frames = bf->bf_nframes;
 			tx_info_priv->n_bad_frames = nbad;
+			tx_info_priv->update_rc = 1;
 		}
 	}
 }
Signature · 1 line
1.5.5.1
maintainer
#1 lore raw

drivers/net/wireless/ath9k/xmit.c static void ath_tx_rc_status(struct ath_buf *bf, struct ath_desc *ds, int nbad)

Quoted 5 lines · Vasanthakumar Thiagarajan
drivers/net/wireless/ath9k/xmit.c +3 -0
+	u8 update_rc;
 
+	tx_info_priv->update_rc = 0;
 
+			tx_info_priv->update_rc = 1;

You could use a bool and use false/true, that'd generate exactly the same code but might be easier to read. Not that it matters much I guess.

johannes

#2 lore raw
Quoted 4 lines · Johannes Berg
Quoted 1 line · Vasanthakumar Thiagarajan
drivers/net/wireless/ath9k/rc.h +1 -0
+	u8 update_rc;
Quoted 8 lines

drivers/net/wireless/ath9k/xmit.c static void ath_tx_rc_status(struct ath_buf *bf, struct ath_desc *ds, int nbad)

Quoted 3 lines
drivers/net/wireless/ath9k/xmit.c +2 -0
+	tx_info_priv->update_rc = 0;
 
+			tx_info_priv->update_rc = 1;

You could use a bool and use false/true, that'd generate exactly the same code but might be easier to read. Not that it matters much I guess.

johannes

Sure, if it improves the readability.

Vasanth