aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2014-11-13 05:06:43 -0500
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>2014-11-24 01:30:18 -0500
commit3771a89022bc4aa56bca5e7d3f34eee46ebedfdb (patch)
tree00722995adf28e5dc6df6ef76b833074fa528bf2
parenteb96ccb138fccdedd76c773e476e4a6ce4b3c05c (diff)
iwlwifi: mvm: pull SNAP header into skb->head
When we pre-populate the skb->head for the stack, we only pull in the 802.11 header including crypto (assuming the packet isn't short enough to be in there completely.) This is fine, but in ieee80211_data_to_8023() we later unconditionally pull 8 more bytes for the SNAP header and ethertype field (except for mesh or 4-addr, where it's even more, but we don't care as much about them). Avoid the additional later pull by pulling in those 8 bytes here. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Reviewed-by: IdoX Yariv <ido@wizery.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/rx.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/rx.c b/drivers/net/wireless/iwlwifi/mvm/rx.c
index 69fa765e29b5..94b6e7297a1e 100644
--- a/drivers/net/wireless/iwlwifi/mvm/rx.c
+++ b/drivers/net/wireless/iwlwifi/mvm/rx.c
@@ -104,10 +104,19 @@ static void iwl_mvm_pass_packet_to_mac80211(struct iwl_mvm *mvm,
104 unsigned int hdrlen, fraglen; 104 unsigned int hdrlen, fraglen;
105 105
106 /* If frame is small enough to fit in skb->head, pull it completely. 106 /* If frame is small enough to fit in skb->head, pull it completely.
107 * If not, only pull ieee80211_hdr (including crypto if present) so 107 * If not, only pull ieee80211_hdr (including crypto if present, and
108 * that splice() or TCP coalesce are more efficient. 108 * an additional 8 bytes for SNAP/ethertype, see below) so that
109 * splice() or TCP coalesce are more efficient.
110 *
111 * Since, in addition, ieee80211_data_to_8023() always pull in at
112 * least 8 bytes (possibly more for mesh) we can do the same here
113 * to save the cost of doing it later. That still doesn't pull in
114 * the actual IP header since the typical case has a SNAP header.
115 * If the latter changes (there are efforts in the standards group
116 * to do so) we should revisit this and ieee80211_data_to_8023().
109 */ 117 */
110 hdrlen = (len <= skb_tailroom(skb)) ? len : sizeof(*hdr) + crypt_len; 118 hdrlen = (len <= skb_tailroom(skb)) ? len :
119 sizeof(*hdr) + crypt_len + 8;
111 120
112 memcpy(skb_put(skb, hdrlen), hdr, hdrlen); 121 memcpy(skb_put(skb, hdrlen), hdr, hdrlen);
113 fraglen = len - hdrlen; 122 fraglen = len - hdrlen;