Skip to contentSkip to conversation

mac80211: fix fast_tx header alignment

PATCH Applied Felix Fietkau 2 participants 2 messages May 19, 2016 – May 31, 2016 mac80211

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mac80211: fix fast_tx header alignment

The header field is defined as u8[] but also accessed as struct ieee80211_hdr. Enforce an alignment of 2 to prevent unnecessary unaligned accesses, which can be very harmful for performance on many platforms.

Fixes e495c24731a2 ("mac80211: extend fast-xmit for more ciphers")
---
 net/mac80211/sta_info.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/mac80211/sta_info.h +1 -1
index 62193f4..ba7ce53 100644
@@ -275,7 +275,7 @@ struct ieee80211_fast_tx {
 	u8 sa_offs, da_offs, pn_offs;
 	u8 band;
 	u8 hdr[30 + 2 + IEEE80211_FAST_XMIT_MAX_IV +
-	       sizeof(rfc1042_header)];
+	       sizeof(rfc1042_header)] __aligned(2);
 
 	struct rcu_head rcu_head;
 };
Signature · 1 line
2.2.2
maintainer Applied
#1 lore raw
Quoted 6 lines · Felix Fietkau

The header field is defined as u8[] but also accessed as struct ieee80211_hdr. Enforce an alignment of 2 to prevent unnecessary unaligned accesses, which can be very harmful for performance on many platforms.

Applied, thanks.

johannes