linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: fix fast_tx header alignment
@ 2016-05-19 15:34 Felix Fietkau
  2016-05-31 10:14 ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: Felix Fietkau @ 2016-05-19 15:34 UTC (permalink / raw)
  To: linux-wireless; +Cc: johannes

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")
Cc: stable@vger.kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 net/mac80211/sta_info.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h
index 62193f4..ba7ce53 100644
--- a/net/mac80211/sta_info.h
+++ b/net/mac80211/sta_info.h
@@ -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;
 };
-- 
2.2.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mac80211: fix fast_tx header alignment
  2016-05-19 15:34 [PATCH] mac80211: fix fast_tx header alignment Felix Fietkau
@ 2016-05-31 10:14 ` Johannes Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2016-05-31 10:14 UTC (permalink / raw)
  To: Felix Fietkau, linux-wireless

On Thu, 2016-05-19 at 17:34 +0200, Felix Fietkau wrote:
> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-05-31 10:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-19 15:34 [PATCH] mac80211: fix fast_tx header alignment Felix Fietkau
2016-05-31 10:14 ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).