From nobody Sun Feb 16 23:27:11 2025 X-Original-To: dev-commits-src-main@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 4Yx24c3NBBz5p5g1; Sun, 16 Feb 2025 23:27:12 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yx24c0mbQz3Z1P; Sun, 16 Feb 2025 23:27:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739748432; 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=9AeE58/mN3DmYTMmOym0Mc+nItloGhZ/q8hkE2Q7M8w=; b=vWZJkd3KqjWhVxeaaipjNXjZyJsALnxKbBkRuigziYOdtnvIFIKzzhYBqrf+B3hKX5tPih O39lD+V9WQmydQtODaU8VXqvwKmdI/q0R2Z7APSSIYgoQ3juY1Vm/ph9SnNK8FyUFmFCeR i16AYOZxjpgVyzM51PSczKw4xrpIYkUZhs1AWgw6p53Zxug0WrQK+drSRCOP776EVauEVP tSiNJqginSRVcw6MrAIIfH3uT18rlor0hED3i0bA9iFG7mDszh7OmSIYA+O+3NvFYvq0gy 4wkPllgrcQ78L4JNjH9nueB61lT0r2oClivfDFOdh/P4O/NC+B98MEIq4tGClQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739748432; a=rsa-sha256; cv=none; b=l0YdearNg6y6qG/DBzadLl0nEUX1Wiz1RScOwzvzh/UgFohBAupe2Nd6Wui7icCiuzPcHM bDHEbT9UTN3n9voXiqxIM9kwrKncJW8JLUMrid+V6j6m1NaTvqwou6OSgB3LGzmznGlSU3 Lz6gucl8KlDLKg8kGxkjp9qlvrCnmQZis3TIfZ9fOjM+i1OtX6S8c/wdr1yd0i0zjp++qk T5DlziZ6IjstWemxQoPEzrsQ9rsB935HQkgryh8PFcop9I5mzAVR8m5/1PkFtrUDZ8As8k rm5PDat/nAW5wXP0KtXno8zErpAnv1wNrlpLHYSlp7T8nxu7NYFdWT5VEwg53A== 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=1739748432; 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=9AeE58/mN3DmYTMmOym0Mc+nItloGhZ/q8hkE2Q7M8w=; b=tn3Yca+iS2F6p7ODNgg8GC8ibY+FuFAa9tNKh4uuk3ZBM/MinH07zZqNyzbU6bvZpPqKs3 9rWH3Dyyuz7iozE/yKQ8XHY/pYaiG+v5SA/cvU2hBzX6kzwPYu5OD3RCkYeX0YPNgplT63 FIJSByj6/s7AtGNLwH7Vb+zix+D4XgasPdv+x2CPUnVR4QkrzCpZJHKE1ufQvErPtKFYd2 OWxPCNjchx5imK0UEKuYIlDCCyjMsK0lUZa/qVpN7w22fzlJFLyyCkDTCvnRolVDGdK+y0 xNJ/eHABs4+NBggMxw7313PTZwNsU12xxR8OlqP4q9cP4XWxXr0yG/58/i/2vg== 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 4Yx24b6rFpz16vt; Sun, 16 Feb 2025 23:27:11 +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 51GNRBQZ022772; Sun, 16 Feb 2025 23:27:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51GNRBo3022769; Sun, 16 Feb 2025 23:27:11 GMT (envelope-from git) Date: Sun, 16 Feb 2025 23:27:11 GMT Message-Id: <202502162327.51GNRBo3022769@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: bcf1d8ee3552 - main - LinuxKPI: 802.11/skb: add extra information for skb alloc failures List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: bcf1d8ee355213eef4a125c0b8518f1cb4f35df4 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=bcf1d8ee355213eef4a125c0b8518f1cb4f35df4 commit bcf1d8ee355213eef4a125c0b8518f1cb4f35df4 Author: Bjoern A. Zeeb AuthorDate: 2024-12-27 21:26:52 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-16 23:04:24 +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 MFC after: 3 days --- 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 1d834673fa74..f695aa4cfc7d 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -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;