linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: use non-zero TID only for QoS frames
@ 2018-09-05  8:00 Johannes Berg
  2018-09-05  8:06 ` Arend van Spriel
  2018-09-05  9:47 ` Toke Høiland-Jørgensen
  0 siblings, 2 replies; 10+ messages in thread
From: Johannes Berg @ 2018-09-05  8:00 UTC (permalink / raw)
  To: linux-wireless
  Cc: Felix Fietkau, Toke Høiland-Jørgensen, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Some frames may have a non-zero skb->priority assigned by
mac80211 internally, e.g. TDLS setup frames, regardless of
support for QoS.

Currently, we set skb->priority to 0 for all data frames.
Note that there's a comment that this is "required for
correct WPA/11i MIC", but that doesn't seem true as we use

        if (ieee80211_is_data_qos(hdr->frame_control))
                qos_tid = ieee80211_get_tid(hdr);
        else
                qos_tid = 0;

in the code there. We could therefore reconsider this, but
it seems like unnecessary complexity for the unlikely (and
not very useful) case of not having QoS on the connection.

This situation then causes something strange - most data
frames will go on TXQ for TID 0 for non-QoS connections,
but very few exceptions that are internally generated will
go on another TXQ, possibly causing confusion.

Avoid this confusion by putting non-QoS data frames into
TID 0 regardless of the skb->priority.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/mac80211/tx.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 5b6e06ad35ff..6540595addd1 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1260,7 +1260,10 @@ static struct txq_info *ieee80211_get_txq(struct ieee80211_local *local,
 			txq = sta->sta.txq[IEEE80211_NUM_TIDS];
 		}
 	} else if (sta) {
-		u8 tid = skb->priority & IEEE80211_QOS_CTL_TID_MASK;
+		u8 tid = 0;
+
+		if (hdr->frame_control & cpu_to_le16(IEEE80211_STYPE_QOS_DATA))
+			tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK;
 
 		if (!sta->uploaded)
 			return NULL;
-- 
2.14.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-09-05 15:42 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-05  8:00 [PATCH] mac80211: use non-zero TID only for QoS frames Johannes Berg
2018-09-05  8:06 ` Arend van Spriel
2018-09-05  8:09   ` Johannes Berg
2018-09-05  9:47 ` Toke Høiland-Jørgensen
2018-09-05  9:50   ` Johannes Berg
2018-09-05  9:56     ` Toke Høiland-Jørgensen
2018-09-05 10:56       ` Johannes Berg
2018-09-05 11:07         ` Toke Høiland-Jørgensen
2018-09-05 11:08           ` Johannes Berg
2018-09-05 11:12             ` Toke Høiland-Jørgensen

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).