diff mbox

[1/3] mac80211: update A-MPDU flag on tx dequeue

Message ID 20161104092754.91649-1-nbd@nbd.name (mailing list archive)
State Accepted
Delegated to: Johannes Berg
Headers show

Commit Message

Felix Fietkau Nov. 4, 2016, 9:27 a.m. UTC
The sequence number counter is used to derive the starting sequence
number. Since that counter is updated on tx dequeue, the A-MPDU flag
needs to be up to date at the tme of dequeue as well.

This patch prevents sending more A-MPDU frames after the session has
been terminated and also ensures that aggregation starts right after the
session has been established

Fixes: bb42f2d13ffc ("mac80211: Move reorder-sensitive TX handlers to after TXQ dequeue")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 net/mac80211/tx.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Toke Høiland-Jørgensen Nov. 4, 2016, 11:46 a.m. UTC | #1
Felix Fietkau <nbd@nbd.name> writes:

> The sequence number counter is used to derive the starting sequence
> number. Since that counter is updated on tx dequeue, the A-MPDU flag
> needs to be up to date at the tme of dequeue as well.
>
> This patch prevents sending more A-MPDU frames after the session has
> been terminated and also ensures that aggregation starts right after the
> session has been established

Makes sense. Suppose there's no reason why the session couldn't be
started/ended while packets were queued.

Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>
Johannes Berg Nov. 15, 2016, 1:38 p.m. UTC | #2
All three applied, thanks.

johannes
diff mbox

Patch

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 62ccaf6..c380e85 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -3451,6 +3451,11 @@  struct sk_buff *ieee80211_tx_dequeue(struct ieee80211_hw *hw,
 		goto begin;
 	}
 
+	if (test_bit(IEEE80211_TXQ_AMPDU, &txqi->flags))
+		info->flags |= IEEE80211_TX_CTL_AMPDU;
+	else
+		info->flags &= ~IEEE80211_TX_CTL_AMPDU;
+
 	if (info->control.flags & IEEE80211_TX_CTRL_FAST_XMIT) {
 		struct sta_info *sta = container_of(txq->sta, struct sta_info,
 						    sta);