git: b5e3a31ac050 - stable/13 - LinuxKPI: 802.11: disable early queue wakeup workaround; better classify

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Fri, 14 Jun 2024 18:43:04 UTC
The branch stable/13 has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=b5e3a31ac050dd376d19682fe0e595692ec3379f

commit b5e3a31ac050dd376d19682fe0e595692ec3379f
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2024-02-16 21:14:02 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2024-06-14 14:55:16 +0000

    LinuxKPI: 802.11: disable early queue wakeup workaround; better classify
    
    We used to call lkpi_wake_tx_queues() for all queues early on in order
    to make sure they are ready.  Turns out whatever logic in iwlwifi
    startup is working correctly these days under LinuxKPI so this is no
    longer needed.  As the comment indicated the "workaround" did not
    always work.  Disable it for now.
    
    The second part of the improvement is to properly classify Non-QOS
    non-data frames (mgmt and ctl frames for now, unless we have to be
    even more careful in the future about certain sub-types) as TID 7/VO.
    Contrary to net80211 we must not promote PAE frames.
    
    PR:             274382
    Reviewed by:    cc
    Differential Revision: https://reviews.freebsd.org/D43944
    
    (cherry picked from commit 1665ef979d3adab05d178480077674ab5978e4f0)
---
 sys/compat/linuxkpi/common/src/linux_80211.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c
index 1a5954de0250..d90f89cdcbcd 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211.c
+++ b/sys/compat/linuxkpi/common/src/linux_80211.c
@@ -1312,6 +1312,7 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int
 
 	lkpi_lsta_dump(lsta, ni, __func__, __LINE__);
 
+#if 0
 	/*
 	 * Wakeup all queues now that sta is there so we have as much time to
 	 * possibly prepare the queue in the driver to be ready for the 1st
@@ -1321,6 +1322,7 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int
 	 * for all queues.
 	 */
 	lkpi_wake_tx_queues(hw, LSTA_TO_STA(lsta), false, false);
+#endif
 
 	/* Start mgd_prepare_tx. */
 	memset(&prep_tx_info, 0, sizeof(prep_tx_info));
@@ -3670,8 +3672,16 @@ lkpi_80211_txq_tx_one(struct lkpi_sta *lsta, struct mbuf *m)
 	hdr = (void *)skb->data;
 	tid = linuxkpi_ieee80211_get_tid(hdr, true);
 	if (tid == IEEE80211_NONQOS_TID) { /* == IEEE80211_NUM_TIDS */
-		skb->priority = 0;
-		ac = IEEE80211_AC_BE;
+		if (!ieee80211_is_data(hdr->frame_control)) {
+			/* MGMT and CTRL frames go on TID 7/VO. */
+			skb->priority = 7;
+			ac = IEEE80211_AC_VO;
+		} else {
+			/* Other non-QOS traffic goes to BE. */
+			/* Contrary to net80211 we MUST NOT promote M_EAPOL. */
+			skb->priority = 0;
+			ac = IEEE80211_AC_BE;
+		}
 	} else {
 		skb->priority = tid & IEEE80211_QOS_CTL_TID_MASK;
 		ac = ieee80211e_up_to_ac[tid & 7];