From patchwork Wed Nov 4 06:18:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathy Vanhoef X-Patchwork-Id: 11879675 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2D4E614B4 for ; Wed, 4 Nov 2020 06:19:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 18C00208C7 for ; Wed, 4 Nov 2020 06:19:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728340AbgKDGTZ (ORCPT ); Wed, 4 Nov 2020 01:19:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728162AbgKDGTZ (ORCPT ); Wed, 4 Nov 2020 01:19:25 -0500 Received: from rhcavuit04.kulnet.kuleuven.be (rhcavuit04.kulnet.kuleuven.be [IPv6:2a02:2c40:0:c0::25:137]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4377C061A4D for ; Tue, 3 Nov 2020 22:19:24 -0800 (PST) X-KULeuven-Envelope-From: mathy.vanhoef@kuleuven.be X-Spam-Status: not spam, SpamAssassin (not cached, score=-50.999, required 5, autolearn=disabled, ALL_TRUSTED -1.00, LOCAL_SMTPS -50.00, URIBL_BLOCKED 0.00) X-KULeuven-Scanned: Found to be clean X-KULeuven-ID: 7327B120333.A2861 X-KULeuven-Information: Katholieke Universiteit Leuven Received: from icts-p-smtps-2.cc.kuleuven.be (icts-p-smtps-2e.kulnet.kuleuven.be [134.58.240.34]) by rhcavuit04.kulnet.kuleuven.be (Postfix) with ESMTP id 7327B120333 for ; Wed, 4 Nov 2020 07:19:17 +0100 (CET) Received: from mathy-work.localhost (unknown [92.96.39.204]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by icts-p-smtps-2.cc.kuleuven.be (Postfix) with ESMTPSA id BEDE2200A1; Wed, 4 Nov 2020 07:19:12 +0100 (CET) X-Kuleuven: This mail passed the K.U.Leuven mailcluster From: Mathy Vanhoef To: Johannes Berg , linux-wireless@vger.kernel.org, ath9k-devel@qca.qualcomm.com, Kalle Valo Cc: Mathy Vanhoef Subject: [PATCH 1/5] mac80211: add radiotap flag to assure frames are not reordered Date: Wed, 4 Nov 2020 10:18:19 +0400 Message-Id: <20201104061823.197407-2-Mathy.Vanhoef@kuleuven.be> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201104061823.197407-1-Mathy.Vanhoef@kuleuven.be> References: <20201104061823.197407-1-Mathy.Vanhoef@kuleuven.be> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Add a new radiotap flag to indicate injected frames must not be reordered relative to other frames that also have this flag set, independent of priority field values in the transmitted frame. Parse this radiotap flag and define and set a corresponding Tx control flag. Note that this flag has recently been standardized as part of an update to radiotap. Signed-off-by: Mathy Vanhoef --- include/net/ieee80211_radiotap.h | 1 + include/net/mac80211.h | 4 ++++ net/mac80211/tx.c | 3 +++ 3 files changed, 8 insertions(+) diff --git a/include/net/ieee80211_radiotap.h b/include/net/ieee80211_radiotap.h index 19c00d100..c0854933e 100644 --- a/include/net/ieee80211_radiotap.h +++ b/include/net/ieee80211_radiotap.h @@ -118,6 +118,7 @@ enum ieee80211_radiotap_tx_flags { IEEE80211_RADIOTAP_F_TX_RTS = 0x0004, IEEE80211_RADIOTAP_F_TX_NOACK = 0x0008, IEEE80211_RADIOTAP_F_TX_NOSEQNO = 0x0010, + IEEE80211_RADIOTAP_F_TX_ORDER = 0x0020, }; /* for IEEE80211_RADIOTAP_MCS "have" flags */ diff --git a/include/net/mac80211.h b/include/net/mac80211.h index e8e295dae..69864b5ef 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -856,6 +856,9 @@ enum mac80211_tx_info_flags { * it can be sent out. * @IEEE80211_TX_CTRL_NO_SEQNO: Do not overwrite the sequence number that * has already been assigned to this frame. + * @IEEE80211_TX_CTRL_DONT_REORDER: This frame should not be reordered + * relative to other frames that have this flag set, independent + * of their QoS TID or other priority field values. * * These flags are used in tx_info->control.flags. */ @@ -868,6 +871,7 @@ enum mac80211_tx_control_flags { IEEE80211_TX_CTRL_SKIP_MPATH_LOOKUP = BIT(5), IEEE80211_TX_INTCFL_NEED_TXPROCESSING = BIT(6), IEEE80211_TX_CTRL_NO_SEQNO = BIT(7), + IEEE80211_TX_CTRL_DONT_REORDER = BIT(8), }; /* diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 8ba10a48d..d4e1a2720 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -2102,6 +2102,9 @@ bool ieee80211_parse_tx_radiotap(struct sk_buff *skb, info->flags |= IEEE80211_TX_CTL_NO_ACK; if (txflags & IEEE80211_RADIOTAP_F_TX_NOSEQNO) info->control.flags |= IEEE80211_TX_CTRL_NO_SEQNO; + if (txflags & IEEE80211_RADIOTAP_F_TX_ORDER) + info->control.flags |= + IEEE80211_TX_CTRL_DONT_REORDER; break; case IEEE80211_RADIOTAP_RATE: From patchwork Wed Nov 4 06:18:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathy Vanhoef X-Patchwork-Id: 11879681 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 61518174A for ; Wed, 4 Nov 2020 06:19:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4EFB7208C7 for ; Wed, 4 Nov 2020 06:19:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728523AbgKDGTk (ORCPT ); Wed, 4 Nov 2020 01:19:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727901AbgKDGTk (ORCPT ); Wed, 4 Nov 2020 01:19:40 -0500 Received: from rhcavuit02.kulnet.kuleuven.be (rhcavuit02.kulnet.kuleuven.be [IPv6:2a02:2c40:0:c0::25:130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B8E4C061A4D for ; Tue, 3 Nov 2020 22:19:40 -0800 (PST) X-KULeuven-Envelope-From: mathy.vanhoef@kuleuven.be X-Spam-Status: not spam, SpamAssassin (not cached, score=-50.999, required 5, autolearn=disabled, ALL_TRUSTED -1.00, LOCAL_SMTPS -50.00, URIBL_BLOCKED 0.00) X-KULeuven-Scanned: Found to be clean X-KULeuven-ID: 007D512032F.AA427 X-KULeuven-Information: Katholieke Universiteit Leuven Received: from icts-p-smtps-2.cc.kuleuven.be (icts-p-smtps-2e.kulnet.kuleuven.be [134.58.240.34]) by rhcavuit02.kulnet.kuleuven.be (Postfix) with ESMTP id 007D512032F for ; Wed, 4 Nov 2020 07:19:26 +0100 (CET) Received: from mathy-work.localhost (unknown [92.96.39.204]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by icts-p-smtps-2.cc.kuleuven.be (Postfix) with ESMTPSA id 3D2ED200A1; Wed, 4 Nov 2020 07:19:24 +0100 (CET) X-Kuleuven: This mail passed the K.U.Leuven mailcluster From: Mathy Vanhoef To: Johannes Berg , linux-wireless@vger.kernel.org, ath9k-devel@qca.qualcomm.com, Kalle Valo Cc: Mathy Vanhoef Subject: [PATCH 2/5] mac80211: adhere to Tx control flag that prevents frame reordering Date: Wed, 4 Nov 2020 10:18:20 +0400 Message-Id: <20201104061823.197407-3-Mathy.Vanhoef@kuleuven.be> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201104061823.197407-1-Mathy.Vanhoef@kuleuven.be> References: <20201104061823.197407-1-Mathy.Vanhoef@kuleuven.be> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org When the Tx control flag is set to prevent frame reordering, send all frames that have this flag set on the same queue. This assures that frames that have this flag set are not reordered relative to other frames that have this flag set. Signed-off-by: Mathy Vanhoef --- net/mac80211/wme.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c index 2fb993251..3d7dea387 100644 --- a/net/mac80211/wme.c +++ b/net/mac80211/wme.c @@ -118,9 +118,11 @@ u16 ieee80211_select_queue_80211(struct ieee80211_sub_if_data *sdata, struct ieee80211_hdr *hdr) { struct ieee80211_local *local = sdata->local; + struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); u8 *p; - if (local->hw.queues < IEEE80211_NUM_ACS) + if ((info->control.flags & IEEE80211_TX_CTRL_DONT_REORDER) || + local->hw.queues < IEEE80211_NUM_ACS) return 0; if (!ieee80211_is_data(hdr->frame_control)) { @@ -141,6 +143,7 @@ u16 ieee80211_select_queue_80211(struct ieee80211_sub_if_data *sdata, u16 __ieee80211_select_queue(struct ieee80211_sub_if_data *sdata, struct sta_info *sta, struct sk_buff *skb) { + struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); struct mac80211_qos_map *qos_map; bool qos; @@ -153,7 +156,7 @@ u16 __ieee80211_select_queue(struct ieee80211_sub_if_data *sdata, else qos = false; - if (!qos) { + if (!qos || (info->control.flags & IEEE80211_TX_CTRL_DONT_REORDER)) { skb->priority = 0; /* required for correct WPA/11i MIC */ return IEEE80211_AC_BE; } From patchwork Wed Nov 4 06:18:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathy Vanhoef X-Patchwork-Id: 11879677 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5099417D3 for ; Wed, 4 Nov 2020 06:19:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3E32A208C7 for ; Wed, 4 Nov 2020 06:19:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728380AbgKDGTd (ORCPT ); Wed, 4 Nov 2020 01:19:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728162AbgKDGTd (ORCPT ); Wed, 4 Nov 2020 01:19:33 -0500 Received: from rhcavuit03.kulnet.kuleuven.be (rhcavuit03.kulnet.kuleuven.be [IPv6:2a02:2c40:0:c0::25:136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E336CC061A4D for ; Tue, 3 Nov 2020 22:19:32 -0800 (PST) X-KULeuven-Envelope-From: mathy.vanhoef@kuleuven.be X-Spam-Status: not spam, SpamAssassin (not cached, score=-50.999, required 5, autolearn=disabled, ALL_TRUSTED -1.00, LOCAL_SMTPS -50.00, URIBL_BLOCKED 0.00) X-KULeuven-Scanned: Found to be clean X-KULeuven-ID: 92ADA12032F.A1C46 X-KULeuven-Information: Katholieke Universiteit Leuven Received: from icts-p-smtps-2.cc.kuleuven.be (icts-p-smtps-2e.kulnet.kuleuven.be [134.58.240.34]) by rhcavuit03.kulnet.kuleuven.be (Postfix) with ESMTP id 92ADA12032F for ; Wed, 4 Nov 2020 07:19:30 +0100 (CET) Received: from mathy-work.localhost (unknown [92.96.39.204]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by icts-p-smtps-2.cc.kuleuven.be (Postfix) with ESMTPSA id D17A8200A1; Wed, 4 Nov 2020 07:19:28 +0100 (CET) X-Kuleuven: This mail passed the K.U.Leuven mailcluster From: Mathy Vanhoef To: Johannes Berg , linux-wireless@vger.kernel.org, ath9k-devel@qca.qualcomm.com, Kalle Valo Cc: Mathy Vanhoef Subject: [PATCH 3/5] mac80211: don't overwrite QoS TID of injected frames Date: Wed, 4 Nov 2020 10:18:21 +0400 Message-Id: <20201104061823.197407-4-Mathy.Vanhoef@kuleuven.be> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201104061823.197407-1-Mathy.Vanhoef@kuleuven.be> References: <20201104061823.197407-1-Mathy.Vanhoef@kuleuven.be> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Currently ieee80211_set_qos_hdr set the QoS TID of all frames based on the value assigned to skb->priority. This means it will also overwrite the QoS TID of injected frames. The commit 753ffad3d624 ("mac80211: fix TID field in monitor mode transmit") prevented injected frames from being modified because of this by setting skb->priority to the TID of the injected frame, which assured the QoS TID will not be changed to a different value. Unfortunately, this workaround complicates the handling of injected frames because we can't set skb->priority without affecting the TID value in the QoS field of injected frames. To avoid this, and to implify the next patch, detect if a frame is injected in ieee80211_set_qos_hdr and if so do not change its QoS field. Signed-off-by: Mathy Vanhoef --- net/mac80211/tx.c | 5 +---- net/mac80211/wme.c | 8 ++++++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index d4e1a2720..8bf80b675 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -2271,10 +2271,7 @@ netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb, payload[7]); } - /* - * Initialize skb->priority for QoS frames. This is put in the TID field - * of the frame before passing it to the driver. - */ + /* Initialize skb->priority for QoS frames */ if (ieee80211_is_data_qos(hdr->frame_control)) { u8 *p = ieee80211_get_qos_ctl(hdr); skb->priority = *p & IEEE80211_QOS_CTL_TAG1D_MASK; diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c index 3d7dea387..2702d314e 100644 --- a/net/mac80211/wme.c +++ b/net/mac80211/wme.c @@ -252,6 +252,14 @@ void ieee80211_set_qos_hdr(struct ieee80211_sub_if_data *sdata, p = ieee80211_get_qos_ctl(hdr); + /* don't overwrite the QoS field of injected frames */ + if (info->flags & IEEE80211_TX_CTL_INJECTED) { + /* do take into account Ack policy of injected frames */ + if (*p & IEEE80211_QOS_CTL_ACK_POLICY_NOACK) + info->flags |= IEEE80211_TX_CTL_NO_ACK; + return; + } + /* set up the first byte */ /* From patchwork Wed Nov 4 06:18:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathy Vanhoef X-Patchwork-Id: 11879679 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1BE4D16C1 for ; Wed, 4 Nov 2020 06:19:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0A6C9208C7 for ; Wed, 4 Nov 2020 06:19:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728508AbgKDGTh (ORCPT ); Wed, 4 Nov 2020 01:19:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728162AbgKDGTg (ORCPT ); Wed, 4 Nov 2020 01:19:36 -0500 Received: from rhcavuit01.kulnet.kuleuven.be (rhcavuit01.kulnet.kuleuven.be [IPv6:2a02:2c40:0:c0::25:129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F481C061A4D for ; Tue, 3 Nov 2020 22:19:36 -0800 (PST) X-KULeuven-Envelope-From: mathy.vanhoef@kuleuven.be X-Spam-Status: not spam, SpamAssassin (not cached, score=-50.999, required 5, autolearn=disabled, ALL_TRUSTED -1.00, LOCAL_SMTPS -50.00, URIBL_BLOCKED 0.00) X-KULeuven-Scanned: Found to be clean X-KULeuven-ID: 98292120325.A2667 X-KULeuven-Information: Katholieke Universiteit Leuven Received: from icts-p-smtps-2.cc.kuleuven.be (icts-p-smtps-2e.kulnet.kuleuven.be [134.58.240.34]) by rhcavuit01.kulnet.kuleuven.be (Postfix) with ESMTP id 98292120325 for ; Wed, 4 Nov 2020 07:19:34 +0100 (CET) Received: from mathy-work.localhost (unknown [92.96.39.204]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by icts-p-smtps-2.cc.kuleuven.be (Postfix) with ESMTPSA id CFDBF200A1; Wed, 4 Nov 2020 07:19:32 +0100 (CET) X-Kuleuven: This mail passed the K.U.Leuven mailcluster From: Mathy Vanhoef To: Johannes Berg , linux-wireless@vger.kernel.org, ath9k-devel@qca.qualcomm.com, Kalle Valo Cc: Mathy Vanhoef Subject: [PATCH 4/5] mac80211: assure that certain drivers adhere to DONT_REORDER flag Date: Wed, 4 Nov 2020 10:18:22 +0400 Message-Id: <20201104061823.197407-5-Mathy.Vanhoef@kuleuven.be> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201104061823.197407-1-Mathy.Vanhoef@kuleuven.be> References: <20201104061823.197407-1-Mathy.Vanhoef@kuleuven.be> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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 --- net/mac80211/tx.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 8bf80b675..1651cf7b2 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -2271,8 +2271,13 @@ netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb, payload[7]); } - /* Initialize skb->priority for QoS frames */ - if (ieee80211_is_data_qos(hdr->frame_control)) { + /* Initialize skb->priority for QoS frames. If the DONT_REORDER flag + * is set, stick to the default value for skb->priority to assure + * frames injected with this flag are not reordered relative to each + * other. + */ + if (ieee80211_is_data_qos(hdr->frame_control) && + !(info->control.flags & IEEE80211_TX_CTRL_DONT_REORDER)) { u8 *p = ieee80211_get_qos_ctl(hdr); skb->priority = *p & IEEE80211_QOS_CTL_TAG1D_MASK; } From patchwork Wed Nov 4 06:18:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathy Vanhoef X-Patchwork-Id: 11879683 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E9CB514B4 for ; Wed, 4 Nov 2020 06:19:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D420222384 for ; Wed, 4 Nov 2020 06:19:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728541AbgKDGTz (ORCPT ); Wed, 4 Nov 2020 01:19:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727901AbgKDGTy (ORCPT ); Wed, 4 Nov 2020 01:19:54 -0500 Received: from rhcavuit02.kulnet.kuleuven.be (rhcavuit02.kulnet.kuleuven.be [IPv6:2a02:2c40:0:c0::25:130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 272FDC061A4D for ; Tue, 3 Nov 2020 22:19:54 -0800 (PST) X-KULeuven-Envelope-From: mathy.vanhoef@kuleuven.be X-Spam-Status: not spam, SpamAssassin (not cached, score=-50.999, required 5, autolearn=disabled, ALL_TRUSTED -1.00, LOCAL_SMTPS -50.00, URIBL_BLOCKED 0.00) X-KULeuven-Scanned: Found to be clean X-KULeuven-ID: EE09312032F.A1960 X-KULeuven-Information: Katholieke Universiteit Leuven Received: from icts-p-smtps-2.cc.kuleuven.be (icts-p-smtps-2e.kulnet.kuleuven.be [134.58.240.34]) by rhcavuit02.kulnet.kuleuven.be (Postfix) with ESMTP id EE09312032F for ; Wed, 4 Nov 2020 07:19:40 +0100 (CET) Received: from mathy-work.localhost (unknown [92.96.39.204]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by icts-p-smtps-2.cc.kuleuven.be (Postfix) with ESMTPSA id 15B76200A1; Wed, 4 Nov 2020 07:19:38 +0100 (CET) X-Kuleuven: This mail passed the K.U.Leuven mailcluster From: Mathy Vanhoef To: Johannes Berg , linux-wireless@vger.kernel.org, ath9k-devel@qca.qualcomm.com, Kalle Valo Cc: Mathy Vanhoef Subject: [PATCH 5/5] ath9k_htc: adhere to the DONT_REORDER transmit flag Date: Wed, 4 Nov 2020 10:18:23 +0400 Message-Id: <20201104061823.197407-6-Mathy.Vanhoef@kuleuven.be> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201104061823.197407-1-Mathy.Vanhoef@kuleuven.be> References: <20201104061823.197407-1-Mathy.Vanhoef@kuleuven.be> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Assure that frames with the fixed order flag are not reordered relative to each other. This is accomplished by transmitting them using a fixed priority independent of their QoS field. Signed-off-by: Mathy Vanhoef --- drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c index 0bdc4dcb7..8e69e8989 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c @@ -297,7 +297,12 @@ static void ath9k_htc_tx_data(struct ath9k_htc_priv *priv, tx_hdr.data_type = ATH9K_HTC_NORMAL; } - if (ieee80211_is_data_qos(hdr->frame_control)) { + /* Transmit all frames that should not be reordered relative + * to each other using the same priority. For other QoS data + * frames extract the priority from the header. + */ + if (!(tx_info->control.flags & IEEE80211_TX_CTRL_DONT_REORDER) && + ieee80211_is_data_qos(hdr->frame_control)) { qc = ieee80211_get_qos_ctl(hdr); tx_hdr.tidno = qc[0] & IEEE80211_QOS_CTL_TID_MASK; }