From nobody Fri Jan 16 19:41:32 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 4dt9G44wr0z6Nlj7 for ; Fri, 16 Jan 2026 19:41:32 +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 "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dt9G436Gcz3y25 for ; Fri, 16 Jan 2026 19:41:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1768592492; 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=ke/oyLxNau4HU4Ur69KLmBx1mYdR+WsD4veR1lL0vB8=; b=O4evpTirX1euAN3UA1eSAX5AybWya9wy+ovZ11owWyA1ky24MDi3ZmCJGtd11M+eeWDnfK GN05ipiWDJEBDjK44519Q+Bw8qCnYqt2lLVSSIdymMCTOUEoo9NHL4jTbu2XVYwHnnAGOw hYQFMfJSRjMXodlEsBZHg6ArnbayfKy9FqcRUOvCylo9hdSN2a25uHXoeemQHoKdwTCFoh W/L9uZU5Tv/G26LvtZdvJwT0dj+VNwODoJ7oXPxUvs48eHflzkpwhJZjVbIDko118OjuIt m5plpwrE/rhGZjO2Ec65gJue3BETUgadj9TolWukLPBVYKNIURcZb4VDqevsUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1768592492; 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=ke/oyLxNau4HU4Ur69KLmBx1mYdR+WsD4veR1lL0vB8=; b=iuVmrLcLPXCBNUnCtC+AVasUi+Wyu5JADSe8FWgf2G74zL4/GedXmLi7ybaCgTXqDOW6lb kQmZyWrTX25UsLE8M2VbMZ1YTZX+Z8sCqEpabWsCnmo/zbZfHtRcroBLevC5KBKWN7iIXx fsDpqFvT7/N1fs+C0OauQkP6lpqBeEc4yuQ+6bW4Ebs1op+KenaIF+CCMYyaGsVBu9wWl9 wIpqOrwGznz6EPuQxaGSUEcitmpm/VeOCfsPO8/hWe8R40Rz21HwYaH6aUKVazEbmMFDa+ nS2RK11gOwvQHcF1cbUrkn+OLrDXQ1ybhmJXxf6EHwIYKAUCmQ9vqJ0VChg/Bw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1768592492; a=rsa-sha256; cv=none; b=QFbOGKxjQAtg6QKbOLB5C8oENvzUQ7ty3xrP0exJVxHule8dt8v4jWdxOd/w4CoH++pdu4 jP18Tp3kIjDhs8Nua2CUoowk9t5iOmfsk5xRUZiEmteh5+ApFlYNy/ggnVkUchZ91T7fbD oeLQnxdZ3lTPY85NtbWw6p3cKYwQmPpYd9M1Ax+TmYguK7CqLOnw4auMNz9HzdwytKSxw9 gSfjlb05agC7bFZ+KP5jBi75turPb4ubam9rRriO5tz91IEOE6LukLL0Rk87QOOQ3IjWvc Yw1ZE/bG0O+l4W0dQ22lHGi0eoOl+tKJmvuGR4DJJwhhJ5MlvyiDWJYXg6XroA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dt9G42XSHzCby for ; Fri, 16 Jan 2026 19:41:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id de24 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 16 Jan 2026 19:41:32 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Bjoern A. Zeeb Subject: git: e7c3b91d3017 - stable/14 - LinuxKPI: 802.11: add compat.linuxkpi.80211.IF.dump_stas_queues 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 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/14 X-Git-Reftype: branch X-Git-Commit: e7c3b91d30176988612f3ab95140f50f13f29178 Auto-Submitted: auto-generated Date: Fri, 16 Jan 2026 19:41:32 +0000 Message-Id: <696a946c.de24.c9aa8d8@gitrepo.freebsd.org> The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=e7c3b91d30176988612f3ab95140f50f13f29178 commit e7c3b91d30176988612f3ab95140f50f13f29178 Author: Bjoern A. Zeeb AuthorDate: 2025-12-28 17:03:41 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-01-16 19:37:55 +0000 LinuxKPI: 802.11: add compat.linuxkpi.80211.IF.dump_stas_queues Extend the normal compat.linuxkpi.80211.IF.dump_stas sysctl by queue information. This was helpful for debugging various issues, like selecting the outbound queue, stopping queues for BAR and helped finding multiple bugs. Sponsored by: The FreeBSD Foundation (cherry picked from commit 32ea8209825af594cbfa1fc654d45eb9a6aab528) (cherry picked from commit 6b9c0ac008a9c52b21b05c96ead6def41aa89ead) --- share/man/man4/linuxkpi_wlan.4 | 9 +++- sys/compat/linuxkpi/common/src/linux_80211.c | 78 ++++++++++++++++++++++++++-- sys/compat/linuxkpi/common/src/linux_80211.h | 4 ++ 3 files changed, 85 insertions(+), 6 deletions(-) diff --git a/share/man/man4/linuxkpi_wlan.4 b/share/man/man4/linuxkpi_wlan.4 index e433fc1c8549..b4e7262a9b1e 100644 --- a/share/man/man4/linuxkpi_wlan.4 +++ b/share/man/man4/linuxkpi_wlan.4 @@ -6,7 +6,7 @@ .\" This documentation was written by Bj\xc3\xb6rn Zeeb under sponsorship from .\" the FreeBSD Foundation. .\" -.Dd June 13, 2025 +.Dd December 28, 2025 .Dt LINUXKPI_WLAN 4 .Os .Sh NAME @@ -108,6 +108,13 @@ Print statistics for a given, associated .Xr wlan 4 interface; typically IF would be .Em wlan0 . +.It Va compat.linuxkpi.80211.IF.dump_stas_queues +Like +.Va compat.linuxkpi.80211.IF.dump_stas +but also print queue statistics. +This sysctl is +.Sq hidden +and normally only needed for debugging purposes. .El .Sh SEE ALSO .Xr iwlwifi 4 , diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index a92f3f75912d..e82b1eecc0ac 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -275,7 +275,7 @@ lkpi_nl80211_sta_info_to_str(struct sbuf *s, const char *prefix, } static void -lkpi_80211_dump_lvif_stas(struct lkpi_vif *lvif, struct sbuf *s) +lkpi_80211_dump_lvif_stas(struct lkpi_vif *lvif, struct sbuf *s, bool dump_queues) { struct lkpi_hw *lhw; struct ieee80211_hw *hw; @@ -285,6 +285,7 @@ lkpi_80211_dump_lvif_stas(struct lkpi_vif *lvif, struct sbuf *s) struct ieee80211_sta *sta; struct station_info sinfo; int error; + uint8_t tid; vif = LVIF_TO_VIF(lvif); vap = LVIF_TO_VAP(lvif); @@ -369,6 +370,39 @@ lkpi_80211_dump_lvif_stas(struct lkpi_vif *lvif, struct sbuf *s) sbuf_printf(s, " he_dcm %u he_gi %u he_ru_alloc %u eht_gi %u\n", sinfo.txrate.he_dcm, sinfo.txrate.he_gi, sinfo.txrate.he_ru_alloc, sinfo.txrate.eht_gi); + + if (!dump_queues) + continue; + + /* Dump queue information. */ + sbuf_printf(s, " Queue information:\n"); + sbuf_printf(s, " frms direct tx %ju\n", lsta->frms_tx); + for (tid = 0; tid <= IEEE80211_NUM_TIDS; tid++) { + struct lkpi_txq *ltxq; + + if (sta->txq[tid] == NULL) { + sbuf_printf(s, " tid %-2u NOQ\n", tid); + continue; + } + + ltxq = TXQ_TO_LTXQ(sta->txq[tid]); +#ifdef __notyet__ + sbuf_printf(s, " tid %-2u flags: %b " + "txq_generation %u skbq len %d\n", + tid, ltxq->flags, LKPI_TXQ_FLAGS_BITS, + ltxq->txq_generation, + skb_queue_len_lockless(<xq->skbq)); +#else + sbuf_printf(s, " tid %-2u " + "txq_generation %u skbq len %d\n", + tid, + ltxq->txq_generation, + skb_queue_len_lockless(<xq->skbq)); +#endif + sbuf_printf(s, " frms_enqueued %ju frms_dequeued %ju " + "frms_tx %ju\n", + ltxq->frms_enqueued, ltxq->frms_dequeued, ltxq->frms_tx); + } } wiphy_unlock(hw->wiphy); } @@ -386,7 +420,28 @@ lkpi_80211_dump_stas(SYSCTL_HANDLER_ARGS) sbuf_new_for_sysctl(&s, NULL, 1024, req); - lkpi_80211_dump_lvif_stas(lvif, &s); + lkpi_80211_dump_lvif_stas(lvif, &s, false); + + sbuf_finish(&s); + sbuf_delete(&s); + + return (0); +} + +static int +lkpi_80211_dump_sta_queues(SYSCTL_HANDLER_ARGS) +{ + struct lkpi_vif *lvif; + struct sbuf s; + + if (req->newptr) + return (EPERM); + + lvif = (struct lkpi_vif *)arg1; + + sbuf_new_for_sysctl(&s, NULL, 1024, req); + + lkpi_80211_dump_lvif_stas(lvif, &s, true); sbuf_finish(&s); sbuf_delete(&s); @@ -4019,6 +4074,11 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], SYSCTL_CHILDREN(node), OID_AUTO, "dump_stas", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, lvif, 0, lkpi_80211_dump_stas, "A", "Dump sta statistics of this vif"); + SYSCTL_ADD_PROC(&lvif->sysctl_ctx, + SYSCTL_CHILDREN(node), OID_AUTO, "dump_stas_queues", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE | CTLFLAG_SKIP, lvif, 0, + lkpi_80211_dump_sta_queues, "A", + "Dump queue statistics for any sta of this vif"); IMPROVE(); @@ -5244,6 +5304,7 @@ lkpi_80211_txq_tx_one(struct lkpi_sta *lsta, struct mbuf *m) LKPI_80211_LTXQ_LOCK(ltxq); skb_queue_tail(<xq->skbq, skb); + ltxq->frms_enqueued++; #ifdef LINUXKPI_DEBUG_80211 if (linuxkpi_debug_80211 & D80211_TRACE_TX) printf("%s:%d mo_wake_tx_queue :: %d %u lsta %p sta %p " @@ -5273,6 +5334,7 @@ ops_tx: control.sta = sta; wiphy_lock(hw->wiphy); lkpi_80211_mo_tx(hw, &control, skb); + lsta->frms_tx++; wiphy_unlock(hw->wiphy); } @@ -7591,6 +7653,8 @@ linuxkpi_ieee80211_tx_dequeue(struct ieee80211_hw *hw, LKPI_80211_LTXQ_LOCK(ltxq); skb = skb_dequeue(<xq->skbq); + if (skb != NULL) + ltxq->frms_dequeued++; LKPI_80211_LTXQ_UNLOCK(ltxq); stopped: @@ -8232,18 +8296,21 @@ linuxkpi_ieee80211_handle_wake_tx_queue(struct ieee80211_hw *hw, struct ieee80211_txq *txq) { struct lkpi_hw *lhw; - struct ieee80211_txq *ntxq; - struct ieee80211_tx_control control; - struct sk_buff *skb; lhw = HW_TO_LHW(hw); LKPI_80211_LHW_TXQ_LOCK(lhw); ieee80211_txq_schedule_start(hw, txq->ac); do { + struct lkpi_txq *ltxq; + struct ieee80211_txq *ntxq; + struct ieee80211_tx_control control; + struct sk_buff *skb; + ntxq = ieee80211_next_txq(hw, txq->ac); if (ntxq == NULL) break; + ltxq = TXQ_TO_LTXQ(ntxq); memset(&control, 0, sizeof(control)); control.sta = ntxq->sta; @@ -8251,6 +8318,7 @@ linuxkpi_ieee80211_handle_wake_tx_queue(struct ieee80211_hw *hw, skb = linuxkpi_ieee80211_tx_dequeue(hw, ntxq); if (skb == NULL) break; + ltxq->frms_tx++; lkpi_80211_mo_tx(hw, &control, skb); } while(1); diff --git a/sys/compat/linuxkpi/common/src/linux_80211.h b/sys/compat/linuxkpi/common/src/linux_80211.h index ea5d1d72e78c..bad77a543dba 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.h +++ b/sys/compat/linuxkpi/common/src/linux_80211.h @@ -138,6 +138,9 @@ struct lkpi_txq { bool stopped; uint32_t txq_generation; struct sk_buff_head skbq; + uint64_t frms_enqueued; + uint64_t frms_dequeued; + uint64_t frms_tx; /* Must be last! */ struct ieee80211_txq txq __aligned(CACHE_LINE_SIZE); @@ -164,6 +167,7 @@ struct lkpi_sta { bool in_mgd; /* XXX-BZ should this be per-vif? */ struct station_info sinfo; /* statistics */ + uint64_t frms_tx; /* (*tx) */ /* Must be last! */ struct ieee80211_sta sta __aligned(CACHE_LINE_SIZE);