0188e19b71687363c89ef2bb8b282d3d14f24e96
[openwrt/staging/981213.git] /
1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Mon, 17 Aug 2020 21:11:25 +0200
3 Subject: [PATCH] mac80211: check and refresh aggregation session in encap
4 offload tx
5
6 Update the last_tx timestamp to avoid tearing down the aggregation session
7 early. Fall back to the slow path if the session setup is still running
8
9 Signed-off-by: Felix Fietkau <nbd@nbd.name>
10 ---
11
12 --- a/net/mac80211/tx.c
13 +++ b/net/mac80211/tx.c
14 @@ -4189,6 +4189,8 @@ static void ieee80211_8023_xmit(struct i
15 bool authorized = false;
16 bool multicast;
17 unsigned char *ra = ehdr->h_dest;
18 + struct tid_ampdu_tx *tid_tx;
19 + u8 tid;
20
21 if (IS_ERR(sta) || (sta && !sta->uploaded))
22 sta = NULL;
23 @@ -4226,6 +4228,22 @@ static void ieee80211_8023_xmit(struct i
24
25 memset(info, 0, sizeof(*info));
26
27 + if (sta) {
28 + tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK;
29 + tid_tx = rcu_dereference(sta->ampdu_mlme.tid_tx[tid]);
30 + if (tid_tx) {
31 + if (!test_bit(HT_AGG_STATE_OPERATIONAL, &tid_tx->state)) {
32 + /* fall back to non-offload slow path */
33 + __ieee80211_subif_start_xmit(skb, dev, 0, 0, NULL);
34 + return;
35 + }
36 +
37 + info->flags |= IEEE80211_TX_CTL_AMPDU;
38 + if (tid_tx->timeout)
39 + tid_tx->last_tx = jiffies;
40 + }
41 + }
42 +
43 if (unlikely(!multicast && skb->sk &&
44 skb_shinfo(skb)->tx_flags & SKBTX_WIFI_STATUS))
45 info->ack_frame_id = ieee80211_store_ack_skb(local, skb,