Skip to contentSkip to conversation

mac80211: retry sending failed BAR frames later instead of tearing down aggr

PATCH In review Felix Fietkau 2 participants 2 messages Sep 7, 2011 mac80211

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 mac80211: retry sending failed BAR frames later instead of tearing down aggr

Unfortunately failed BAR tx attempts happen more frequently than I expected, and the resulting aggregation teardowns cause performance issues, as the aggregation session does not always get re-established properly.
Instead of tearing down the entire aggr session, we can simply store the SSN of the last failed BAR tx attempt, wait for the first successful tx status event, and then send another BAR with the same SSN.

Also fix an endian bug on accessing the control field of the BAR

---
 net/mac80211/sta_info.h |    5 +++++
 net/mac80211/status.c   |   44 +++++++++++++++++++++++++++++++++++++++++---
 2 files changed, 46 insertions(+), 3 deletions(-)
net/mac80211/sta_info.h +5 -0
index e9eb565..56a3d38 100644
@@ -86,6 +86,8 @@ enum ieee80211_sta_info_flags {
  * @stop_initiator: initiator of a session stop
  * @tx_stop: TX DelBA frame when stopping
  * @buf_size: reorder buffer size at receiver
+ * @failed_bar_ssn: ssn of the last failed BAR tx attempt
+ * @bar_pending: BAR needs to be re-sent
  *
  * This structure's lifetime is managed by RCU, assignments to
  * the array holding it must hold the aggregation mutex.
@@ -106,6 +108,9 @@ struct tid_ampdu_tx {
 	u8 stop_initiator;
 	bool tx_stop;
 	u8 buf_size;
+
+	u16 failed_bar_ssn;
+	bool bar_pending;
 };
 
 /**
net/mac80211/status.c +41 -3

76 lines not on this page · raw message

Signature · 1 line
1.7.3.2
#1 lore raw
Quoted 9 lines · Felix Fietkau

Unfortunately failed BAR tx attempts happen more frequently than I expected, and the resulting aggregation teardowns cause performance issues, as the aggregation session does not always get re-established properly.
Instead of tearing down the entire aggr session, we can simply store the SSN of the last failed BAR tx attempt, wait for the first successful tx status event, and then send another BAR with the same SSN.

Also fix an endian bug on accessing the control field of the BAR

Thanks for the endian fix!

[...]

net/mac80211/status.c void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb) · line 285

Quoted 9 lines
net/mac80211/status.c +2 -0
@@ -246,6 +278,8 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
                }
 
                if (!acked && ieee80211_is_back_req(fc)) {
+                       u16 control;
+
                        /*
                         * BAR failed, let's tear down the BA session as a
                         * last resort as some STAs (Intel 5100 on Windows)

The comment should be updated as well.

Helmut