Skip to content

Commit 1e5b775

Browse files
jmberg-intellucacoelho
authored andcommitted
iwlwifi: mvm: move skb padding reservation earlier
Future changes will require moving the HE radiotap data into the SKB head, but this means we need to have the alignment reservation done before that. To prepare, move the alignment reservation earlier here. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
1 parent 18e8f43 commit 1e5b775

File tree

1 file changed

+11
-9
lines changed
  • drivers/net/wireless/intel/iwlwifi/mvm

1 file changed

+11
-9
lines changed

drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -151,17 +151,9 @@ static void iwl_mvm_create_skb(struct sk_buff *skb, struct ieee80211_hdr *hdr,
151151
unsigned int hdrlen = ieee80211_hdrlen(hdr->frame_control);
152152

153153
if (desc->mac_flags2 & IWL_RX_MPDU_MFLG2_PAD) {
154+
len -= 2;
154155
pad_len = 2;
155-
156-
/*
157-
* If the device inserted padding it means that (it thought)
158-
* the 802.11 header wasn't a multiple of 4 bytes long. In
159-
* this case, reserve two bytes at the start of the SKB to
160-
* align the payload properly in case we end up copying it.
161-
*/
162-
skb_reserve(skb, pad_len);
163156
}
164-
len -= pad_len;
165157

166158
/* If frame is small enough to fit in skb->head, pull it completely.
167159
* If not, only pull ieee80211_hdr (including crypto if present, and
@@ -866,6 +858,16 @@ void iwl_mvm_rx_mpdu_mq(struct iwl_mvm *mvm, struct napi_struct *napi,
866858
return;
867859
}
868860

861+
if (desc->mac_flags2 & IWL_RX_MPDU_MFLG2_PAD) {
862+
/*
863+
* If the device inserted padding it means that (it thought)
864+
* the 802.11 header wasn't a multiple of 4 bytes long. In
865+
* this case, reserve two bytes at the start of the SKB to
866+
* align the payload properly in case we end up copying it.
867+
*/
868+
skb_reserve(skb, 2);
869+
}
870+
869871
rx_status = IEEE80211_SKB_RXCB(skb);
870872

871873
if (iwl_mvm_rx_crypto(mvm, hdr, rx_status, desc,

0 commit comments

Comments
 (0)