mirror of
https://github.com/opnsense/src.git
synced 2026-06-07 07:42:26 -04:00
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 MFC after: 3 days
This commit is contained in:
parent
d2407a21bd
commit
bcf1d8ee35
2 changed files with 18 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -3854,7 +3854,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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue