git: b2999f02278d - stable/14 - LinuxKPI: 802.11/skb: add extra information for skb alloc failures
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 24 Feb 2025 20:27:17 UTC
The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=b2999f02278dd4f98fed4089d778639bc980a551 commit b2999f02278dd4f98fed4089d778639bc980a551 Author: Bjoern A. Zeeb <bz@FreeBSD.org> AuthorDate: 2024-12-27 21:26:52 +0000 Commit: Bjoern A. Zeeb <bz@FreeBSD.org> CommitDate: 2025-02-24 20:26:49 +0000 LinuxKPI: 802.11/skb: add extra information for skb alloc failures rtw88 seems to have an skb leak still. Add a WARN_ONCE to __skb_queue_purge() just to make sure there is no glitch due to missing locking. Also add a rolling error reporting for skb allocation failures in LinuxKPI to gather some more information if possible about queue states. This is a corrected version of what was initially part of D48474. Sponsored by: The FreeBSD Foundation (cherry picked from commit bcf1d8ee355213eef4a125c0b8518f1cb4f35df4) (cherry picked from commit 1432e0f20ccde8eaa23d3d3e20fca2989cd344b6) --- sys/compat/linuxkpi/common/include/linux/skbuff.h | 2 ++ sys/compat/linuxkpi/common/src/linux_80211.c | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/skbuff.h b/sys/compat/linuxkpi/common/include/linux/skbuff.h index 341ed33ddfcd..43f35d8f065f 100644 --- a/sys/compat/linuxkpi/common/include/linux/skbuff.h +++ b/sys/compat/linuxkpi/common/include/linux/skbuff.h @@ -706,6 +706,8 @@ __skb_queue_purge(struct sk_buff_head *q) SKB_TRACE(q); while ((skb = __skb_dequeue(q)) != NULL) kfree_skb(skb); + WARN_ONCE(skb_queue_len(q) != 0, "%s: queue %p not empty: %u", + __func__, q, skb_queue_len(q)); } static inline void diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 7bb051a67ade..853d77fd4a96 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -3855,7 +3855,22 @@ lkpi_80211_txq_tx_one(struct lkpi_sta *lsta, struct mbuf *m) */ skb = dev_alloc_skb(hw->extra_tx_headroom + m->m_pkthdr.len); if (skb == NULL) { - ic_printf(ic, "ERROR %s: skb alloc failed\n", __func__); + static uint8_t skb_alloc_failures = 0; + + if (skb_alloc_failures++ == 0) { + int tid; + + sta = LSTA_TO_STA(lsta); + ic_printf(ic, "ERROR %s: skb alloc failed %d + %d, lsta %p sta %p ni %p\n", + __func__, hw->extra_tx_headroom, m->m_pkthdr.len, lsta, sta, ni); + for (tid = 0; tid < nitems(sta->txq); tid++) { + 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)); + } + } ieee80211_free_node(ni); m_freem(m); return;