]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
iwlwifi: mvm: don't send fetch the TID from a non-QoS packet in TSO
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Tue, 20 Jun 2017 13:05:30 +0000 (16:05 +0300)
committerLuca Coelho <luciano.coelho@intel.com>
Thu, 29 Jun 2017 17:39:29 +0000 (20:39 +0300)
Getting the TID of a packet before we know it is a QoS data
packet isn't a good idea. Delay the TID retrieval until
we know the packet is a QoS data packet.

Fixes: bb81bb68f472 ("iwlwifi: mvm: add Tx A-MSDU inside A-MPDU")
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/tx.c

index 12a35af6691864aee448069fac6845778de6ff43..172f0aa8d019a5250e9a6701f1604fb2014e1852 100644 (file)
@@ -715,11 +715,6 @@ static int iwl_mvm_tx_tso(struct iwl_mvm *mvm, struct sk_buff *skb,
        snap_ip_tcp = 8 + skb_transport_header(skb) - skb_network_header(skb) +
                tcp_hdrlen(skb);
 
-       qc = ieee80211_get_qos_ctl(hdr);
-       tid = *qc & IEEE80211_QOS_CTL_TID_MASK;
-       if (WARN_ON_ONCE(tid >= IWL_MAX_TID_COUNT))
-               return -EINVAL;
-
        dbg_max_amsdu_len = ACCESS_ONCE(mvm->max_amsdu_len);
 
        if (!sta->max_amsdu_len ||
@@ -730,6 +725,11 @@ static int iwl_mvm_tx_tso(struct iwl_mvm *mvm, struct sk_buff *skb,
                goto segment;
        }
 
+       qc = ieee80211_get_qos_ctl(hdr);
+       tid = *qc & IEEE80211_QOS_CTL_TID_MASK;
+       if (WARN_ON_ONCE(tid >= IWL_MAX_TID_COUNT))
+               return -EINVAL;
+
        /*
         * Do not build AMSDU for IPv6 with extension headers.
         * ask stack to segment and checkum the generated MPDUs for us.