On Mon, Feb 18, 2019 at 03:25:28PM +0100, Lorenzo Bianconi wrote: > > commit 0d9813319b40399a0d8fd761d2fcfedee5701487 > > Author: Lorenzo Bianconi <lorenzo.bianconi@xxxxxxxxxx> > > Date: Fri Sep 7 23:13:12 2018 +0200 > > [...] > > > diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_util.c b/drivers/net/wireless/mediatek/mt76/mt76x02_util.c > > index 062614ad0d51..08425b1d2c30 100644 > > --- a/drivers/net/wireless/mediatek/mt76/mt76x02_util.c > > +++ b/drivers/net/wireless/mediatek/mt76/mt76x02_util.c > > @@ -550,21 +550,33 @@ void mt76x02_sta_rate_tbl_update(struct ieee80211_hw *hw, > > } > > EXPORT_SYMBOL_GPL(mt76x02_sta_rate_tbl_update); > > > > -int mt76x02_insert_hdr_pad(struct sk_buff *skb) > > +void mt76x02_align_skb(struct sk_buff *skb) > > { > > - int len = ieee80211_get_hdrlen_from_skb(skb); > > + int align = ((unsigned long) skb->data) & 3; > > + int hdrlen, skblen; > > > > - if (len % 4 == 0) > > - return 0; > > + hdrlen = ieee80211_get_hdrlen_from_skb(skb); > > + WARN_ON_ONCE(align == 0 && (hdrlen & 3)); > > + > > + if (align == 0) > > + return; > > Hi Stanislaw, > > is it possible that skb->data is 4 byte aligned but hdrlen is not? (e.g 4addr > data frames, not qos)? It might be possible, so for now I add this WARN_ON_ONCE(align == 0 && (hdrlen & 3)); and plan to do some investigation on frame aliment. > are you sure this is true *only* for probe requests? > this could hit performances and it is used even in pci code I'm not 100% sure, but I haven't seen any other frames with that. All other unaligned frames I've seen in my tests had unaligned header and adding header pad aligned them. But obviously I've haven't tested all possible scenarios. Stanislaw