linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mathy Vanhoef <Mathy.Vanhoef@kuleuven.be>
To: Johannes Berg <johannes@sipsolutions.net>,
	linux-wireless@vger.kernel.org, ath9k-devel@qca.qualcomm.com,
	Kalle Valo <kvalo@codeaurora.org>
Cc: Mathy Vanhoef <Mathy.Vanhoef@kuleuven.be>
Subject: [RFC 3/5] mac80211: don't overwrite QoS TID of injected frames
Date: Fri, 24 Jul 2020 09:51:02 +0400	[thread overview]
Message-ID: <20200724055104.105675-3-Mathy.Vanhoef@kuleuven.be> (raw)
In-Reply-To: <20200724055104.105675-1-Mathy.Vanhoef@kuleuven.be>

Currently ieee80211_set_qos_hdr overwrites the QoS TID of injected
frames based on the value assigned to skb->priority. The commit
753ffad3d624 ("mac80211: fix TID field in monitor mode transmit")
worked around this problem 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 of injected frames.

To avoid this, and to simplify 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 <Mathy.Vanhoef@kuleuven.be>
---
 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 23fa19148..96069683f 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -2266,10 +2266,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 a49dd7f1f..e66d1463d 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 */
 
 	/*
-- 
2.27.0


  parent reply	other threads:[~2020-07-24  5:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-24  5:47 [RFC 0/5] Add radiotap flag to prevent frame reordering Mathy Vanhoef
2020-07-24  5:51 ` [RFC 1/5] mac80211: add radiotap flag to assure frames are not reordered Mathy Vanhoef
2020-07-24  5:51   ` [RFC 2/5] mac80211: adhere to Tx control flag that prevents frame reordering Mathy Vanhoef
2020-07-24  5:51   ` Mathy Vanhoef [this message]
2020-07-24  5:51   ` [RFC 4/5] mac80211: assure that certain drivers adhere to DONT_REORDER flag Mathy Vanhoef
2020-07-24  5:51   ` [RFC 5/5] ath9k_htc: adhere to the DONT_REORDER transmit flag Mathy Vanhoef

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=20200724055104.105675-3-Mathy.Vanhoef@kuleuven.be \
    --to=mathy.vanhoef@kuleuven.be \
    --cc=ath9k-devel@qca.qualcomm.com \
    --cc=johannes@sipsolutions.net \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    /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).