linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luca Coelho <luca@coelho.fi>
To: kvalo@codeaurora.org
Cc: linux-wireless@vger.kernel.org,
	Johannes Berg <johannes.berg@intel.com>,
	Luca Coelho <luciano.coelho@intel.com>
Subject: [PATCH 06/12] iwlwifi: mvm: move skb padding reservation earlier
Date: Sun, 22 Apr 2018 11:27:39 +0300	[thread overview]
Message-ID: <20180422082745.9743-7-luca@coelho.fi> (raw)
In-Reply-To: <20180422082745.9743-1-luca@coelho.fi>

From: Johannes Berg <johannes.berg@intel.com>

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 <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 20 ++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
index 34791628cfb3..bb63e75a9b7f 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
@@ -151,17 +151,9 @@ static void iwl_mvm_create_skb(struct sk_buff *skb, struct ieee80211_hdr *hdr,
 	unsigned int hdrlen = ieee80211_hdrlen(hdr->frame_control);
 
 	if (desc->mac_flags2 & IWL_RX_MPDU_MFLG2_PAD) {
+		len -= 2;
 		pad_len = 2;
-
-		/*
-		 * If the device inserted padding it means that (it thought)
-		 * the 802.11 header wasn't a multiple of 4 bytes long. In
-		 * this case, reserve two bytes at the start of the SKB to
-		 * align the payload properly in case we end up copying it.
-		 */
-		skb_reserve(skb, pad_len);
 	}
-	len -= pad_len;
 
 	/* If frame is small enough to fit in skb->head, pull it completely.
 	 * 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,
 		return;
 	}
 
+	if (desc->mac_flags2 & IWL_RX_MPDU_MFLG2_PAD) {
+		/*
+		 * If the device inserted padding it means that (it thought)
+		 * the 802.11 header wasn't a multiple of 4 bytes long. In
+		 * this case, reserve two bytes at the start of the SKB to
+		 * align the payload properly in case we end up copying it.
+		 */
+		skb_reserve(skb, 2);
+	}
+
 	rx_status = IEEE80211_SKB_RXCB(skb);
 
 	if (iwl_mvm_rx_crypto(mvm, hdr, rx_status, desc,
-- 
2.17.0

  parent reply	other threads:[~2018-04-22  8:28 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-22  8:27 [PATCH 00/12] iwlwifi: updates intended for v4.18 2018-04-22 Luca Coelho
2018-04-22  8:27 ` [PATCH 01/12] iwlwifi: allow different csr flags for different device families Luca Coelho
2018-05-27 12:08   ` iwlwifi: regression due to: " Alexander Wetzel
2018-05-31  6:30     ` Luca Coelho
2018-05-31  8:44       ` Kalle Valo
2018-05-31  9:17         ` Luca Coelho
2018-04-22  8:27 ` [PATCH 02/12] iwlwifi: introduce Image Loader (IML) - new firmware image Luca Coelho
2018-04-22  8:27 ` [PATCH 03/12] iwlwifi: cfg: remove unnecessary cfg data in non-dvm devices Luca Coelho
2018-04-22  8:27 ` [PATCH 04/12] iwlwifi: pcie: allow sending pre-built A-MSDUs Luca Coelho
2018-04-22  8:27 ` [PATCH 05/12] iwlwifi: support new csr addresses for hw address Luca Coelho
2018-04-22  8:27 ` Luca Coelho [this message]
2018-04-22  8:27 ` [PATCH 07/12] iwlwifi: fw: harden page loading code Luca Coelho
2018-04-22  8:27 ` [PATCH 08/12] iwlwifi: fw: combine loading of last page block into main copy loop Luca Coelho
2018-04-22  8:27 ` [PATCH 09/12] iwlwifi: pcie: remove non-responsive device Luca Coelho
2018-04-24  9:44   ` Kalle Valo
2018-04-24 10:56     ` Luca Coelho
2018-04-25  8:01       ` Kalle Valo
2018-04-26  7:46         ` Luca Coelho
2018-04-26  7:53   ` [PATCH v2 12/12] " Luca Coelho
2018-04-26  7:55     ` Luciano Coelho
2018-04-22  8:27 ` [PATCH 10/12] iwlwifi: make bitfield a u32 instead of u16 Luca Coelho
2018-04-22  8:27 ` [PATCH 11/12] iwlwifi: mvm: remove check for non low latency TIDs Luca Coelho
2018-04-22  8:27 ` [PATCH 12/12] iwlwifi: mvm: set wakeup filters for wowlan "any" configuration Luca Coelho
2018-04-24  9:45   ` Kalle Valo
2018-04-24 10:56     ` Luca Coelho
2018-04-26  7:52   ` [PATCH v2 " Luca Coelho

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180422082745.9743-7-luca@coelho.fi \
    --to=luca@coelho.fi \
    --cc=johannes.berg@intel.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luciano.coelho@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).