304-mac80211-fix-fast_tx-header-alignment.patch 796 B

12345678910111213141516171819202122232425
  1. From: Felix Fietkau <nbd@nbd.name>
  2. Date: Thu, 19 May 2016 17:32:13 +0200
  3. Subject: [PATCH] mac80211: fix fast_tx header alignment
  4. The header field is defined as u8[] but also accessed as struct
  5. ieee80211_hdr. Enforce an alignment of 2 to prevent unnecessary
  6. unaligned accesses, which can be very harmful for performance on many
  7. platforms.
  8. Fixes: e495c24731a2 ("mac80211: extend fast-xmit for more ciphers")
  9. Cc: stable@vger.kernel.org
  10. Signed-off-by: Felix Fietkau <nbd@nbd.name>
  11. ---
  12. --- a/net/mac80211/sta_info.h
  13. +++ b/net/mac80211/sta_info.h
  14. @@ -280,7 +280,7 @@ struct ieee80211_fast_tx {
  15. u8 sa_offs, da_offs, pn_offs;
  16. u8 band;
  17. u8 hdr[30 + 2 + IEEE80211_FAST_XMIT_MAX_IV +
  18. - sizeof(rfc1042_header)];
  19. + sizeof(rfc1042_header)] __aligned(2);
  20. struct rcu_head rcu_head;
  21. };