Skip to contentSkip to conversation

mac80211: use 16 bit alignment for the if_ibss bssid field

PATCH In review Felix Fietkau 2 participants 2 messages Mar 1, 2012 mac80211

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mac80211: use 16 bit alignment for the if_ibss bssid field

Several MAC address comparison functions assume 16 bit alignment for pointers passed to them. Since the addition of the control_port field, alignment for the IBSS bssid was off by one, causing a severe performance hit on architectures without efficient unaligned access (e.g. MIPS).

---
 net/mac80211/ieee80211_i.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/mac80211/ieee80211_i.h +1 -1
index cee0c74..c413058 100644
@@ -480,7 +480,7 @@ struct ieee80211_if_ibss {
 
 	bool control_port;
 
-	u8 bssid[ETH_ALEN];
+	u8 bssid[ETH_ALEN] __aligned(2);
 	u8 ssid[IEEE80211_MAX_SSID_LEN];
 	u8 ssid_len, ie_len;
 	u8 *ie;
Signature · 1 line
1.7.3.2
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Felix Fietkau

Several MAC address comparison functions assume 16 bit alignment for pointers passed to them. Since the addition of the control_port field, alignment for the IBSS bssid was off by one, causing a severe performance hit on architectures without efficient unaligned access (e.g. MIPS).

Quoted 17 lines
---
 net/mac80211/ieee80211_i.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/mac80211/ieee80211_i.h +1 -1
index cee0c74..c413058 100644
@@ -480,7 +480,7 @@ struct ieee80211_if_ibss {
 
 	bool control_port;
 
-	u8 bssid[ETH_ALEN];
+	u8 bssid[ETH_ALEN] __aligned(2);
 	u8 ssid[IEEE80211_MAX_SSID_LEN];
 	u8 ssid_len, ie_len;
 	u8 *ie;