From nobody Mon Feb 24 20:27:17 2025 X-Original-To: dev-commits-src-branches@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 4Z1sjR2LL8z5pq1v; Mon, 24 Feb 2025 20:27:23 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1sjM5wMKz3p45; Mon, 24 Feb 2025 20:27:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428839; 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=tsytHZVXSKjTm2pJe7S1LufKv2veD80VnVKRiKBOZ9E=; b=iSR107s4RD/d7a9LCtVwdiWwf9KZ47lrZjDSicTOEDI2dsgdsfw+luvbcP9jcpcusuGhAo R/FcLpncUXD9ZBj6MUve0yT48/HNOS511ZypQBR0TLDTEXf9wKqz6OuBOx+ouCb9hXCE0j LVZRANxYduw2uXdFT7rLpUO6rnNtywhtPt7COUkpeMdWnu4o+DsCsaEvf2eup6j595kZ/z Ih96fymF7yREamf6x2AG/1TANWCl4kx2MRfK4otAHtJby9LcJBHm7vvlk6EXKs3JkfD7ur ldyqb1CYZsXSy9WXyQD+zVyrNdBKu7mxmeap448lwSr47kkwAGwXgZChuYjjUw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740428839; a=rsa-sha256; cv=none; b=mmTWz0HsuaLDnJGUtCZVUDyr251Q01DgPHRfLArrJ0232QNuqNdeZZ2xcHyny9MWjgVmS4 3MMHkGxKbJg+0KZrVwxucrLn7xYyrtfPleQJghM6oZynBWvVTS6GdOHyMgI1/JcaLh+K1B znMEdof0fE808VLKeGArMNoCXhPoRusU9IES7zDjJLbgxKrGcpheP2qfMo0n99l/8xSUXw ri00Vpganr/0DBCTjxlThTWqz7vUO5+En5u8zzf+JSefg4nNK5Yw7Ew1LDBfwojhQVLjit dGs2VF6fHGjZZHUwxzoALDv6w1JbmV282sVPEwbQ3EQierAhhsaquWL5EvytAw== 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=1740428839; 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=tsytHZVXSKjTm2pJe7S1LufKv2veD80VnVKRiKBOZ9E=; b=hMj3kqo+keC5684egxg8F3Z7wSX33JQYDDkRZgWrUAzR3a1JAKi/USQZx6M7xEipDZkFUq HvD1aHhEO7XSDd23ZNKGy528yENWlNuySb5oOLgSYHK3AEdokhG7VViMr7c2MpBc8tL3Fu u85TWewz56QvlolAJqcAHu5QqtG52V1MSb8E9yb8Kb74qv5FcY3+j9sCSaJoMvVAYnTven NopEpJwnP23LFsqUwVU0VeGX1mDrPKsELQYKorv7epmTVjMW9Z0rETQYGR4mavDmH5NDC4 8ugme0ap52RdKh/fZhabT3lQ4f3RwgkJEQndGN+KCvmRie2ImQ+7ocrvPUdNFg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1sjK4lvXzvrS; Mon, 24 Feb 2025 20:27:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OKRHgo027492; Mon, 24 Feb 2025 20:27:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OKRHd5027489; Mon, 24 Feb 2025 20:27:17 GMT (envelope-from git) Date: Mon, 24 Feb 2025 20:27:17 GMT Message-Id: <202502242027.51OKRHd5027489@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: b2999f02278d - stable/14 - LinuxKPI: 802.11/skb: add extra information for skb alloc failures List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: b2999f02278dd4f98fed4089d778639bc980a551 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=b2999f02278dd4f98fed4089d778639bc980a551 commit b2999f02278dd4f98fed4089d778639bc980a551 Author: Bjoern A. Zeeb AuthorDate: 2024-12-27 21:26:52 +0000 Commit: Bjoern A. Zeeb 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;