The branch main has been updated by bz:

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

commit 0cbcfa1964de89cd346ee6f79437c6ab83a3b716
Author:     Bjoern A. Zeeb <[email protected]>
AuthorDate: 2023-02-07 20:18:08 +0000
Commit:     Bjoern A. Zeeb <[email protected]>
CommitDate: 2023-02-07 20:20:33 +0000

    LinuxKPI: 802.11: deal with stopped queues
    
    Following 5a9a0d7803382321b5f9fff1deae5fb08463cf1a initialize the
    queue values explicitly and deal with a stopped queue in
    ieee80211_tx_dequeue().
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      3 days
---
 sys/compat/linuxkpi/common/src/linux_80211.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c 
b/sys/compat/linuxkpi/common/src/linux_80211.c
index dc158699f4cf..fdfa384c1a25 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211.c
+++ b/sys/compat/linuxkpi/common/src/linux_80211.c
@@ -244,9 +244,11 @@ lkpi_lsta_alloc(struct ieee80211vap *vap, const uint8_t 
mac[IEEE80211_ADDR_LEN],
                        ltxq->txq.ac = tid_to_mac80211_ac[tid & 7];
                }
                ltxq->seen_dequeue = false;
+               ltxq->stopped = false;
                ltxq->txq.vif = vif;
                ltxq->txq.tid = tid;
                ltxq->txq.sta = sta;
+               TAILQ_ELEM_INIT(ltxq, txq_entry);
                skb_queue_head_init(&ltxq->skbq);
                sta->txq[tid] = &ltxq->txq;
        }
@@ -2276,6 +2278,9 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char 
name[IFNAMSIZ],
                        vif->hw_queue[i] = i;
                else
                        vif->hw_queue[i] = 0;
+
+               /* Initialize the queue to running. Stopped? */
+               lvif->hw_queue_stopped[i] = false;
        }
        vif->cab_queue = IEEE80211_INVAL_HW_QUEUE;
 
@@ -4268,13 +4273,25 @@ linuxkpi_ieee80211_tx_dequeue(struct ieee80211_hw *hw,
     struct ieee80211_txq *txq)
 {
        struct lkpi_txq *ltxq;
+       struct lkpi_vif *lvif;
        struct sk_buff *skb;
 
+       skb = NULL;
        ltxq = TXQ_TO_LTXQ(txq);
        ltxq->seen_dequeue = true;
 
+       if (ltxq->stopped)
+               goto stopped;
+
+       lvif = VIF_TO_LVIF(ltxq->txq.vif);
+       if (lvif->hw_queue_stopped[ltxq->txq.ac]) {
+               ltxq->stopped = true;
+               goto stopped;
+       }
+
        skb = skb_dequeue(&ltxq->skbq);
 
+stopped:
        return (skb);
 }
 

Reply via email to