mac80211: update to version based on 4.19-rc4
[openwrt/staging/stintel.git] / package / kernel / mac80211 / patches / 386-mac80211-do-not-convert-to-A-MSDU-if-frag-subframe-l.patch
1 From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
2 Date: Wed, 29 Aug 2018 21:03:25 +0200
3 Subject: [PATCH] mac80211: do not convert to A-MSDU if frag/subframe
4 limited
5
6 Do not start to aggregate packets in a A-MSDU frame (converting the
7 first subframe to A-MSDU, adding the header) if max_tx_fragments or
8 max_amsdu_subframes limits are already exceeded by it. In particular,
9 this happens when drivers set the limit to 1 to avoid A-MSDUs at all.
10
11 Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
12 [reword commit message to be more precise]
13 Signed-off-by: Johannes Berg <johannes.berg@intel.com>
14 ---
15
16 --- a/net/mac80211/tx.c
17 +++ b/net/mac80211/tx.c
18 @@ -3201,9 +3201,6 @@ static bool ieee80211_amsdu_aggregate(st
19 if (skb->len + head->len > max_amsdu_len)
20 goto unlock;
21
22 - if (!ieee80211_amsdu_prepare_head(sdata, fast_tx, head))
23 - goto out;
24 -
25 nfrags = 1 + skb_shinfo(skb)->nr_frags;
26 nfrags += 1 + skb_shinfo(head)->nr_frags;
27 frag_tail = &skb_shinfo(head)->frag_list;
28 @@ -3219,6 +3216,9 @@ static bool ieee80211_amsdu_aggregate(st
29 if (max_frags && nfrags > max_frags)
30 goto out;
31
32 + if (!ieee80211_amsdu_prepare_head(sdata, fast_tx, head))
33 + goto out;
34 +
35 /*
36 * Pad out the previous subframe to a multiple of 4 by adding the
37 * padding to the next one, that's being added. Note that head->len