From nobody Mon Apr 14 14:07:43 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 4Zbpyl5wMfz5ssmP; Mon, 14 Apr 2025 14:07:43 +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 4Zbpyl3frHz3Qh7; Mon, 14 Apr 2025 14:07:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1744639663; 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=nsnxpaQe2nh6K6IzyOe0FS2dt8toPNBvYlrSlWI5iRM=; b=KSYwWCsP+kDaOxU8pAEzAmdr/UR+N2Da/xZoMrhPYcqg0nD7hRw9+9qpGdJg9yeqRZCfu7 rU8NsCDHh4J5g8DnbSZ0I0qfRJGksrMlrRhDXPY3JGGonpqd+NLuFczFzXG3CvwyNVjB3D tvN9B7CvkOz7XK1l6vzmq7Ns0+RX4hMI1fa62zKyCMIw8aW5EoO0QXJ1wS3koQPGx94/8E s++IEtzbSPbV2LXZgMoMHO86iSN1bpNQSK2wARLWqKJT+/xZ8hZ3CDYa+GKhkdEf1wJQhU KX8NC/otKiJIvH4R6DCRPczABCQ8GeJhSmDc7Yy/0L5E2Aubb4sMu8r4D9o/MQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1744639663; a=rsa-sha256; cv=none; b=hswihgMulpqoQxLsIrrTIT2/ZWorwnLVuBblj76FeqDqfO5eV8XdmuJAm1DvbdQ4jha83F nMqRedLzt6Fjwey5S1VAxvCLJfvBx4xbWXeZAvkf9t4QDuluwaudSLsbLfQMMJSePLD3x6 Nq0FXsoAO3wdy2nXU1MohJWXxImki3FXI4xjjINEPpJ4uZUpZsbY+Gja9XL3b7lS72Gz3Y 0kDUbkXZz86fQho0o7OezVtgm695N+BibSlf1LTN0pkvsPr+FSUkQIxU21mVTZo9oIJ2Iu 1/bJWHr8ZxMr8fzPJmyQ/314jOKb1cfPBk5AC0Mnt4ifMb3CDr4A2pBE2EV/6g== 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=1744639663; 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=nsnxpaQe2nh6K6IzyOe0FS2dt8toPNBvYlrSlWI5iRM=; b=AO6bnBzAtUaumOJb1pg71wIrDrfes7CbO2SUAEyWwpVmwZXJuaaTbeseQxa3L5BF7b3qtN Y1JFtXs0OdQL7t6XuIRDLVclXibnz+tKRmPRwawev6zmMMM1uAchAmlBdDVogm+urZohKY LEPeRoLnN1jt+pwZgaIWSeLekK5GwobNZueM9uOEnS7/CNzy8CryhWxtsNmANfe9NtvLje 23QlL7/kqKd3G9VEUj8PP3DAyl5A61nu4dgrddFQo7Txggoa7qcI83LeoVqoPw50o8Q76t ddfGFfOd1rBxPRlZVHx8RTH8kxc05/rxR6ZmFxiLrfBPpc7je5zNvfumGvDwIQ== 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 4Zbpyl3FYxzs1d; Mon, 14 Apr 2025 14:07:43 +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 53EE7hJG032524; Mon, 14 Apr 2025 14:07:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 53EE7hc1032521; Mon, 14 Apr 2025 14:07:43 GMT (envelope-from git) Date: Mon, 14 Apr 2025 14:07:43 GMT Message-Id: <202504141407.53EE7hc1032521@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: dbae3dcff72f - main - LinuxKPI: 802.11: avoid using an mbuf tag for now 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: dbae3dcff72f53abe6874466baea78f552b3a316 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=dbae3dcff72f53abe6874466baea78f552b3a316 commit dbae3dcff72f53abe6874466baea78f552b3a316 Author: Bjoern A. Zeeb AuthorDate: 2025-04-13 21:53:44 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-04-14 14:06:51 +0000 LinuxKPI: 802.11: avoid using an mbuf tag for now We are using an mbuf tag to carry the ni reference in the TX path from the TX function past the taskq along with the mbuf. Contrary to initial assumptions we only need the ni and no other data so attach the ni to m->m_pkthdr.PH_loc.ptr avoiding the extra allcation. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 22 ++++++++++++++++++++++ sys/compat/linuxkpi/common/src/linux_80211.h | 2 ++ 2 files changed, 24 insertions(+) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 29f4a95f0336..4690c65df468 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -5643,6 +5643,7 @@ linuxkpi_ieee80211_iffree(struct ieee80211_hw *hw) /* Flush mbufq (make sure to release ni refs!). */ m = mbufq_dequeue(&lhw->rxq); while (m != NULL) { +#ifdef LKPI_80211_USE_MTAG struct m_tag *mtag; mtag = m_tag_locate(m, MTAG_ABI_LKPI80211, LKPI80211_TAG_RXNI, NULL); @@ -5652,6 +5653,14 @@ linuxkpi_ieee80211_iffree(struct ieee80211_hw *hw) rxni = (struct lkpi_80211_tag_rxni *)(mtag + 1); ieee80211_free_node(rxni->ni); } +#else + if (m->m_pkthdr.PH_loc.ptr != NULL) { + struct ieee80211_node *ni; + + ni = m->m_pkthdr.PH_loc.ptr; + ieee80211_free_node(ni); + } +#endif m_freem(m); m = mbufq_dequeue(&lhw->rxq); } @@ -6219,10 +6228,13 @@ static void lkpi_80211_lhw_rxq_rx_one(struct lkpi_hw *lhw, struct mbuf *m) { struct ieee80211_node *ni; +#ifdef LKPI_80211_USE_MTAG struct m_tag *mtag; +#endif int ok; ni = NULL; +#ifdef LKPI_80211_USE_MTAG mtag = m_tag_locate(m, MTAG_ABI_LKPI80211, LKPI80211_TAG_RXNI, NULL); if (mtag != NULL) { struct lkpi_80211_tag_rxni *rxni; @@ -6230,6 +6242,12 @@ lkpi_80211_lhw_rxq_rx_one(struct lkpi_hw *lhw, struct mbuf *m) rxni = (struct lkpi_80211_tag_rxni *)(mtag + 1); ni = rxni->ni; } +#else + if (m->m_pkthdr.PH_loc.ptr != NULL) { + ni = m->m_pkthdr.PH_loc.ptr; + m->m_pkthdr.PH_loc.ptr = NULL; + } +#endif if (ni != NULL) { ok = ieee80211_input_mimo(ni, m); @@ -6634,6 +6652,7 @@ skip_device_ts: /* Attach meta-information to the mbuf for the deferred RX path. */ if (ni != NULL) { +#ifdef LKPI_80211_USE_MTAG struct m_tag *mtag; struct lkpi_80211_tag_rxni *rxni; @@ -6647,6 +6666,9 @@ skip_device_ts: rxni = (struct lkpi_80211_tag_rxni *)(mtag + 1); rxni->ni = ni; /* We hold a reference. */ m_tag_prepend(m, mtag); +#else + m->m_pkthdr.PH_loc.ptr = ni; /* We hold a reference. */ +#endif } LKPI_80211_LHW_RXQ_LOCK(lhw); diff --git a/sys/compat/linuxkpi/common/src/linux_80211.h b/sys/compat/linuxkpi/common/src/linux_80211.h index ebf02994af47..6d5476ff8852 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.h +++ b/sys/compat/linuxkpi/common/src/linux_80211.h @@ -86,6 +86,7 @@ #define MTAG_ABI_LKPI80211 1707696513 /* LinuxKPI 802.11 KBI */ +#ifdef LKPI_80211_USE_MTAG /* * Deferred RX path. * We need to pass *ni along (and possibly more in the future so @@ -95,6 +96,7 @@ struct lkpi_80211_tag_rxni { struct ieee80211_node *ni; /* MUST hold a reference to it. */ }; +#endif struct lkpi_radiotap_tx_hdr { struct ieee80211_radiotap_header wt_ihdr;