386-mac80211-do-not-convert-to-A-MSDU-if-frag-subframe-l.patch 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. From: Lorenzo Bianconi <[email protected]>
  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. Do not start to aggregate packets in a A-MSDU frame (converting the
  6. first subframe to A-MSDU, adding the header) if max_tx_fragments or
  7. max_amsdu_subframes limits are already exceeded by it. In particular,
  8. this happens when drivers set the limit to 1 to avoid A-MSDUs at all.
  9. Signed-off-by: Lorenzo Bianconi <[email protected]>
  10. [reword commit message to be more precise]
  11. Signed-off-by: Johannes Berg <[email protected]>
  12. ---
  13. --- a/net/mac80211/tx.c
  14. +++ b/net/mac80211/tx.c
  15. @@ -3201,9 +3201,6 @@ static bool ieee80211_amsdu_aggregate(st
  16. if (skb->len + head->len > max_amsdu_len)
  17. goto unlock;
  18. - if (!ieee80211_amsdu_prepare_head(sdata, fast_tx, head))
  19. - goto out;
  20. -
  21. nfrags = 1 + skb_shinfo(skb)->nr_frags;
  22. nfrags += 1 + skb_shinfo(head)->nr_frags;
  23. frag_tail = &skb_shinfo(head)->frag_list;
  24. @@ -3219,6 +3216,9 @@ static bool ieee80211_amsdu_aggregate(st
  25. if (max_frags && nfrags > max_frags)
  26. goto out;
  27. + if (!ieee80211_amsdu_prepare_head(sdata, fast_tx, head))
  28. + goto out;
  29. +
  30. /*
  31. * Pad out the previous subframe to a multiple of 4 by adding the
  32. * padding to the next one, that's being added. Note that head->len