Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mac80211: assure that certain drivers adhere to DONT_REORDER flag

Some drivers use skb->priority to determine on which queue to send
a frame. An example is mt76x2u (this was tested on an AWUS036ACM).
This means these drivers currently do not adhere to the DONT_REORDER
flag. To fix this, we do not set skb->priority based on the QoS TID
of injected frames when the DONT_REORDER flag is set.

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@kuleuven.be>
Link: https://lore.kernel.org/r/20201104061823.197407-5-Mathy.Vanhoef@kuleuven.be
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

authored by

Mathy Vanhoef and committed by
Johannes Berg
70c5e40c 527d6759

+7 -2
+7 -2
net/mac80211/tx.c
··· 2271 2271 payload[7]); 2272 2272 } 2273 2273 2274 - /* Initialize skb->priority for QoS frames */ 2275 - if (ieee80211_is_data_qos(hdr->frame_control)) { 2274 + /* Initialize skb->priority for QoS frames. If the DONT_REORDER flag 2275 + * is set, stick to the default value for skb->priority to assure 2276 + * frames injected with this flag are not reordered relative to each 2277 + * other. 2278 + */ 2279 + if (ieee80211_is_data_qos(hdr->frame_control) && 2280 + !(info->control.flags & IEEE80211_TX_CTRL_DONT_REORDER)) { 2276 2281 u8 *p = ieee80211_get_qos_ctl(hdr); 2277 2282 skb->priority = *p & IEEE80211_QOS_CTL_TAG1D_MASK; 2278 2283 }