From nobody Mon Jun 29 06:34:16 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4gpc210qcfz6k5CR for ; Mon, 29 Jun 2026 06:34:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gpc2066BVz4GdM for ; Mon, 29 Jun 2026 06:34:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782714856; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sNjGHtUjpUuJi5EEuSsRtJHmQZfTWdhi1fN3RSFErT4=; b=wl97/ZgDsVf8K6OvJ6uaRZPXGP0gCWmiRwA99zt9xaGdUVtfv06NQK1/oX/QhvheP3SMFz lSTnRb3S61B7MiLpbbCFNPHqwI2UX/RIrxyAJ3KZjXeDWnwaevogz/DAkObSEU7Syc/Awm h1zxhevuAgppQuovMLvPhPh++Rdtjqpn2iwFIdjcoJqrHDtRhu6ssoGWDVNe/bTpOsWUmu 7RAPbwR805BLLqOjfMbWGuh8PSPPRHoF3jqXwkuj5CdZq09EFtfgS0zhFjea9/EcRl5Az4 Lz25eD7Dkyz3zG6gQEPwJ/Q2M+pRgBGU3f2LLiGfHi3wkzf+a30SnN/Kiw66IA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782714856; a=rsa-sha256; cv=none; b=iqD6y9EWPpcjB+hpnf4/3JvPIyve/RdYbnTFJuCvoBGZAJI5Kr2q7mV/zXrt1/xbHeZCx6 SdazarSTzAdvLK0IQhKsWRcyVW9ySeBeIZUrqjiTGpfXIblnlcfbNiLb+TDzuwplLNXWCh gEyxk7ZV4q+HjhReJt2j1vbuhVyELdXq+u7bPIhure+UTL4zm0FHJF+SdC7ALSUMxUm1IV aSG7nD9I0p/xwE/3T3GL58eTyK7gfJrh0gYnwoddhkRl6plgArEj5nadFkNl2rN31ILqZc pCGPXFgo1X11CIXk0dmlC1S4oJpZKie6EQKGf1Iqg7hFAYzR6mYC/Mii1AOCzg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782714856; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sNjGHtUjpUuJi5EEuSsRtJHmQZfTWdhi1fN3RSFErT4=; b=hudOr7Fo+e0BFbtHTZl7jH2awnDlk7GIF+X3d7wZWV3OVVYaDlPv/VIKcOYlY2NcuMJirf 7CbWITpr9E9p8QtmCIoeBBv4kch5+4M3QQHI4hN1xzHg+SGNFVLlDddGVEf6bEPiBtAvLe J0WrEocSa5DwEyIbswN+Us/8Bfm2qdIVNzMPxDrlThoGgrN/+S5tXlGcRRpN4dseyGHtMt oFq0PTcIbypInTo8VWxUhYry3D/qpjPVzL+IrJEWwTyi/SgEVk3dwJIRTiVjfLH3VhZPjP pDGN1qSD4tkdtNEr4SCuukD5Da+T1xa5ryfnwDlAcSi9JsxQ7C/yrGMxe1MLaQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gpc2053Wjzmgt for ; Mon, 29 Jun 2026 06:34:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 45ab1 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 29 Jun 2026 06:34:16 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Bjoern A. Zeeb Subject: git: acd657aa2369 - stable/15 - LinuxKPI: 802.11: make *addba* work better List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: acd657aa236905b0d19e372e6e1176e6e81e8536 Auto-Submitted: auto-generated Date: Mon, 29 Jun 2026 06:34:16 +0000 Message-Id: <6a4211e8.45ab1.6e968c34@gitrepo.freebsd.org> The branch stable/15 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=acd657aa236905b0d19e372e6e1176e6e81e8536 commit acd657aa236905b0d19e372e6e1176e6e81e8536 Author: Bjoern A. Zeeb AuthorDate: 2026-04-27 00:48:06 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-06-29 03:52:09 +0000 LinuxKPI: 802.11: make *addba* work better Fill in more details for lkpi_ic_addba_request(), lkpi_ic_addba_response(), and lkpi_ic_addba_response_timeout(). Migrate the ltxq flags seen_dequeue and stopped to a bitfield and add %b support to log messages. This seemed the better approach after needing an additional stop field for BA while we have to hold packets from being transmitted. Sponsored by: The FreeBSD Foundation (cherry picked from commit 259efa730c3d5c52d6ef0faa1d57d66eea5afa8e) --- sys/compat/linuxkpi/common/src/linux_80211.c | 79 ++++++++++++++++++++++------ sys/compat/linuxkpi/common/src/linux_80211.h | 12 ++++- 2 files changed, 74 insertions(+), 17 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 637e8dc9d282..3039d18d7a42 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -891,8 +891,7 @@ lkpi_lsta_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN], } else { ltxq->txq.ac = ieee80211e_up_to_ac[tid & 7]; } - ltxq->seen_dequeue = false; - ltxq->stopped = false; + ltxq->flags = 0; ltxq->txq.vif = vif; ltxq->txq.tid = tid; ltxq->txq.sta = sta; @@ -2173,7 +2172,7 @@ lkpi_wake_tx_queues(struct ieee80211_hw *hw, struct ieee80211_sta *sta, continue; ltxq = TXQ_TO_LTXQ(sta->txq[tid]); - if (dequeue_seen && !ltxq->seen_dequeue) + if (dequeue_seen && (ltxq->flags & LKPI_TXQ_SEEN_DEQUEUE) == 0) continue; LKPI_80211_LTXQ_LOCK(ltxq); @@ -5787,8 +5786,8 @@ lkpi_80211_txq_tx_one(struct lkpi_sta *lsta, struct mbuf *m) if (sta->txq[tid] == NULL) continue; ltxq = TXQ_TO_LTXQ(sta->txq[tid]); - ic_printf(ic, " tid %d ltxq %p seen_dequeue %d stopped %d skb_queue_len %u\n", - tid, ltxq, ltxq->seen_dequeue, ltxq->stopped, skb_queue_len(<xq->skbq)); + ic_printf(ic, " tid %d ltxq %p flags %b skb_queue_len %u\n", + tid, ltxq, ltxq->flags, LKPI_TXQ_FLAGS_BITS, skb_queue_len(<xq->skbq)); } } ieee80211_free_node(ni); @@ -6085,17 +6084,29 @@ lkpi_ic_addba_request(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap, params.tid = tap->txa_tid; params.amsdu = false; - IEEE80211_UNLOCK(ic); + /* We get called from if_transmit all the way up unlocked in net80211. */ + IEEE80211_UNLOCK_ASSERT(ic); wiphy_lock(hw->wiphy); error = lkpi_80211_mo_ampdu_action(hw, vif, ¶ms); wiphy_unlock(hw->wiphy); - IEEE80211_LOCK(ic); - if (error != 0) { + if (error == IEEE80211_AMPDU_TX_START_IMMEDIATE) { + ic_printf(ic, "%s: mo_ampdu_action returned AMPDU_TX_START_IMMEDIATE. " + "ni %p tap %p\n", __func__, ni, tap); + } else if (error != 0) { ic_printf(ic, "%s: mo_ampdu_action returned %d. ni %p tap %p\n", __func__, error, ni, tap); return (0); } + if (sta->txq[tap->txa_tid] != NULL) { + struct lkpi_txq *ltxq; + + ltxq = TXQ_TO_LTXQ(sta->txq[tap->txa_tid]); + TRACEOK("ADDBA REQ ltxq tid %u flags %b qlen %d", tap->txa_tid, + ltxq->flags, LKPI_TXQ_FLAGS_BITS, skb_queue_len(<xq->skbq)); + ltxq->flags |= LKPI_TXQ_STOPPED_BA; + } + return (lhw->ic_addba_request(ni, tap, dialogtoken, baparamset, batimeout)); } @@ -6165,17 +6176,27 @@ lkpi_ic_addba_response(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap params.amsdu = false; } - IEEE80211_UNLOCK(ic); + /* We are called all they way up from ieee80211_input* without lock. */ wiphy_lock(hw->wiphy); error = lkpi_80211_mo_ampdu_action(hw, vif, ¶ms); wiphy_unlock(hw->wiphy); - IEEE80211_LOCK(ic); if (error != 0) { ic_printf(ic, "%s: mo_ampdu_action returned %d. ni %p tap %p\n", __func__, error, ni, tap); return (0); } + if (sta->txq[tap->txa_tid] != NULL) { + struct lkpi_txq *ltxq; + + ltxq = TXQ_TO_LTXQ(sta->txq[tap->txa_tid]); + TRACEOK("ADDBA RESP ltxq tid %u flags %b qlen %d", tap->txa_tid, + ltxq->flags, LKPI_TXQ_FLAGS_BITS, skb_queue_len(<xq->skbq)); + ltxq->flags &= ~LKPI_TXQ_STOPPED_BA; + + lkpi_80211_mo_wake_tx_queue(hw, sta->txq[tap->txa_tid], true); + } + IMPROVE_HT("who unleashes the TXQ? and when?, do we need to ni->ni_txseqs[tid] = tap->txa_start & 0xfff;"); return (lhw->ic_addba_response(ni, tap, status, baparamset, batimeout)); @@ -6246,14 +6267,40 @@ lkpi_ic_addba_response_timeout(struct ieee80211_node *ni, struct ieee80211_tx_am { struct ieee80211com *ic; struct lkpi_hw *lhw; + struct lkpi_sta *lsta; + struct ieee80211_sta *sta; ic = ni->ni_ic; lhw = ic->ic_softc; + lsta = ni->ni_drv_data; + sta = LSTA_TO_STA(lsta); TRACEOK("ADDBA RESP TIMEO tid %u", tap->txa_tid); IMPROVE_HT(); + if (!lsta->added_to_drv) { + ic_printf(ic, "%s: lsta %p ni %p, sta %p not added to firmware\n", + __func__, lsta, ni, sta); + goto n80211; + } + + /* We need to re-enable the txq and get packets out. */ + if (sta->txq[tap->txa_tid] != NULL) { + struct lkpi_txq *ltxq; + struct ieee80211_hw *hw; + + ltxq = TXQ_TO_LTXQ(sta->txq[tap->txa_tid]); + TRACEOK("ADDBA RESP TIMEO ltxq tid %u flags %b qlen %d", + tap->txa_tid, ltxq->flags, LKPI_TXQ_FLAGS_BITS, + skb_queue_len(<xq->skbq)); + ltxq->flags &= ~LKPI_TXQ_STOPPED_BA; + + hw = LHW_TO_HW(lhw); + lkpi_80211_mo_wake_tx_queue(hw, sta->txq[tap->txa_tid], true); + } + +n80211: lhw->ic_addba_response_timeout(ni, tap); } @@ -8586,14 +8633,14 @@ linuxkpi_ieee80211_tx_dequeue(struct ieee80211_hw *hw, IMPROVE("wiphy_lock? or assert?"); skb = NULL; ltxq = TXQ_TO_LTXQ(txq); - ltxq->seen_dequeue = true; + ltxq->flags |= LKPI_TXQ_SEEN_DEQUEUE; - if (ltxq->stopped) + if ((ltxq->flags & (LKPI_TXQ_STOPPED|LKPI_TXQ_STOPPED_BA)) != 0) goto stopped; lvif = VIF_TO_LVIF(ltxq->txq.vif); if (lvif->hw_queue_stopped[ltxq->txq.ac]) { - ltxq->stopped = true; + ltxq->flags |= LKPI_TXQ_STOPPED; goto stopped; } @@ -9096,10 +9143,10 @@ lkpi_ieee80211_wake_queues(struct ieee80211_hw *hw, int hwq) continue; ltxq = TXQ_TO_LTXQ(sta->txq[tid]); - if (!ltxq->stopped) + if ((ltxq->flags & LKPI_TXQ_STOPPED) == 0) continue; - ltxq->stopped = false; + ltxq->flags &= ~LKPI_TXQ_STOPPED; if (!skb_queue_empty(<xq->skbq)) lkpi_80211_mo_wake_tx_queue(hw, sta->txq[tid], false); @@ -9239,6 +9286,8 @@ linuxkpi_ieee80211_next_txq(struct ieee80211_hw *hw, uint8_t ac) goto out; if (ltxq->txq_generation == lhw->txq_generation[ac]) goto out; + if ((ltxq->flags & (LKPI_TXQ_STOPPED|LKPI_TXQ_STOPPED_BA)) != 0) + goto out; IMPROVE("check AIRTIME_FAIRNESS"); diff --git a/sys/compat/linuxkpi/common/src/linux_80211.h b/sys/compat/linuxkpi/common/src/linux_80211.h index f33075b354d2..063be4251ccc 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.h +++ b/sys/compat/linuxkpi/common/src/linux_80211.h @@ -150,12 +150,20 @@ struct lkpi_radiotap_rx_hdr { struct lkpi_hw; +enum lkpi_txq_flags { + LKPI_TXQ_SEEN_DEQUEUE = 0x01, + LKPI_TXQ_STOPPED = 0x02, + LKPI_TXQ_STOPPED_BA = 0x04, +}; +#define LKPI_TXQ_FLAGS_BITS \ + "\010\1SEEN_DEQUEUE\2STOPPED\3STOPPED_BA" + struct lkpi_txq { TAILQ_ENTRY(lkpi_txq) txq_entry; struct mtx ltxq_mtx; - bool seen_dequeue; - bool stopped; + enum lkpi_txq_flags flags; + uint32_t txq_generation; struct sk_buff_head skbq; uint64_t frms_enqueued;