diff options
author | Lorenzo Bianconi <lorenzo.bianconi@redhat.com> | 2018-08-29 21:03:25 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-10-10 08:54:20 +0200 |
commit | 2592adfe326bc98674b53da76fdec7a02a51de07 (patch) | |
tree | 11d4848c02ca36c66d0456da3b43d32cf4b2c003 /net/mac80211/tx.c | |
parent | b22a5d20aab1968d9fd896971ca1706e7c999af9 (diff) | |
download | linux-stable-2592adfe326bc98674b53da76fdec7a02a51de07.tar.gz linux-stable-2592adfe326bc98674b53da76fdec7a02a51de07.tar.bz2 linux-stable-2592adfe326bc98674b53da76fdec7a02a51de07.zip |
mac80211: do not convert to A-MSDU if frag/subframe limited
[ Upstream commit 1eb507903665442360a959136dfa3234c43db085 ]
Do not start to aggregate packets in a A-MSDU frame (converting the
first subframe to A-MSDU, adding the header) if max_tx_fragments or
max_amsdu_subframes limits are already exceeded by it. In particular,
this happens when drivers set the limit to 1 to avoid A-MSDUs at all.
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
[reword commit message to be more precise]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/mac80211/tx.c')
-rw-r--r-- | net/mac80211/tx.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 2064234500cf..fd8dafe73aec 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -3157,9 +3157,6 @@ static bool ieee80211_amsdu_aggregate(struct ieee80211_sub_if_data *sdata, if (skb->len + head->len > max_amsdu_len) goto out; - if (!ieee80211_amsdu_prepare_head(sdata, fast_tx, head)) - goto out; - nfrags = 1 + skb_shinfo(skb)->nr_frags; nfrags += 1 + skb_shinfo(head)->nr_frags; frag_tail = &skb_shinfo(head)->frag_list; @@ -3175,6 +3172,9 @@ static bool ieee80211_amsdu_aggregate(struct ieee80211_sub_if_data *sdata, if (max_frags && nfrags > max_frags) goto out; + if (!ieee80211_amsdu_prepare_head(sdata, fast_tx, head)) + goto out; + /* * Pad out the previous subframe to a multiple of 4 by adding the * padding to the next one, that's being added. Note that head->len |