From nobody Thu Oct 05 15:03:40 2023 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 4S1ZZN4G7hz4vj0d; Thu, 5 Oct 2023 15:03:40 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4S1ZZN3m9Rz4Wmt; Thu, 5 Oct 2023 15:03:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696518220; 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=ooEQPWLY+lfeZXcGytA8EGLdx/RHCek4EelRvBtGly0=; b=u1vQLjIw5I7ciYkN6aaSWUYx35W/zNXSEAexvXlm/ljOe9L/jUO5CkK+N1hi3EF/25J/S2 Zz9Apq+Bo5CFmZ6Gz3EPhGGW7mb/eDWLC+muOHDiChRP9r5ZEgZvcBoHt75xyiM9B9iX3s ZahOKzB7ePf1ABAT6K6TVm/JmBsd1uPD6/w7+ikDQB+ULQKBNgt5yDTVERWTehCJUTaed5 7SLgmGjddyb4Ug5suR2Nc5t5ybetUcct8OuWLdGccSu7yWnBsHBPG2mWCVfuSKWV2+BL+c 7XZG925wAd2lKM4r4KDf+jbNz+O38NxH5dv++ZBPZn+h465uJDxnnwjY5G6sSA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1696518220; a=rsa-sha256; cv=none; b=M70oqPZO1nokBdBIXEMJYxCgeLq+S6Amk3V6QIbzIKt6EznHshJPP6XyQEIC0EVofSqvzf MAziGZB3zymD0XZgZGUmcxt+5n97557C8fKLOZUPm+LLpOhhySoj+KmrypO1kRo4EJhhAi VTjrh0FwbA+JG91rui6yGlqEhspDOdMtIav3xDrfrVW8YPsngqv3TXv9hVWg/PE2PG0Lwi wox/fsw4gUgiynrzXk8LdhbHcYLMo+uI9q0xXd8YAgI4qMgiNhgVSt9ARZIIdmWwg/RApy APLg9GEchCRr3sWWueXEaTijbcx+DhhkZWCdR5P4/FRp0yluPCiYlatVeD8OXg== 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=1696518220; 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=ooEQPWLY+lfeZXcGytA8EGLdx/RHCek4EelRvBtGly0=; b=pV0PIAR6vMAubgE6Jj3MQQ5s7G/Bo3/WeOHQXK2NPeEPjBKii6LPozDv8+Ht1cAiBqO6A+ BkiZAIA24Vlx72xTI46A0yQalfZXZ7dlFs9gd6QrarXy8mygPQ1WvaKIl6kR78sOv/RaFB OFZPZb4bthcqZbBgvgHmoYQ5gHKuzB756vTlQhau7SYv8OdAlv15KENEpAWNfDjtIXHrPY AkDR7Fj4ZSjPHbhtE3UV5/7/pBcLTslMPxAJ3bERt4EX8qnpx2H00T6+/1ZEBQ+c5+e2pT 7dRU1OgiZn+aquoNOjfT41o4f8dQTAJmMuDwM3bDedUXktmU0lAss9JFZ/jdvg== 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 4S1ZZN2q4Sz1PCm; Thu, 5 Oct 2023 15:03:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 395F3e8M061879; Thu, 5 Oct 2023 15:03:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 395F3e2D061876; Thu, 5 Oct 2023 15:03:40 GMT (envelope-from git) Date: Thu, 5 Oct 2023 15:03:40 GMT Message-Id: <202310051503.395F3e2D061876@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: 218885219615 - main - net80211: de-inline ieee80211_ref_node() 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: 2188852196151e5f04533eaa928a7ad0896e4bd6 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=2188852196151e5f04533eaa928a7ad0896e4bd6 commit 2188852196151e5f04533eaa928a7ad0896e4bd6 Author: Bjoern A. Zeeb AuthorDate: 2023-10-02 20:20:14 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-10-05 14:56:02 +0000 net80211: de-inline ieee80211_ref_node() Make ieee80211_ref_node() a macro so we can pass __func__, __LINE__ in for IEEE80211_DEBUG_REFCNT as we do for other refcount related functions. Add the appropriate IEEE80211_DPRINTF() call to the _ieee80211_ref_node() implementation to support wlandebug(8) +node printf style tracing. As a plus we can now also use Dtrace fbt on the _ieee80211_{ref,free}_node() implementations with futher logic, gathering backtraces, etc. more flexibly. Sponsored by: The FreeBSD Foundation X-MFC: never --- sys/net80211/ieee80211_node.c | 14 ++++++++++++++ sys/net80211/ieee80211_node.h | 11 ++++------- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index b7cdc5090c96..88c8ab4eff1c 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -2056,6 +2056,20 @@ _ieee80211_find_txnode(struct ieee80211vap *vap, return ni; } +struct ieee80211_node * +_ieee80211_ref_node(struct ieee80211_node *ni, + const char *func __debrefcnt_used, int line __debrefcnt_used) +{ + +#ifdef IEEE80211_DEBUG_REFCNT + IEEE80211_DPRINTF(ni->ni_vap, IEEE80211_MSG_NODE, + "%s (%s:%u) %p<%s> refcnt %d\n", __func__, func, line, ni, + ether_sprintf(ni->ni_macaddr), ieee80211_node_refcnt(ni)+1); +#endif + ieee80211_node_incref(ni); + return (ni); +} + static void __ieee80211_free_node(struct ieee80211_node *ni) { diff --git a/sys/net80211/ieee80211_node.h b/sys/net80211/ieee80211_node.h index 685df28ed519..954e8e03563f 100644 --- a/sys/net80211/ieee80211_node.h +++ b/sys/net80211/ieee80211_node.h @@ -319,13 +319,6 @@ MALLOC_DECLARE(M_80211_NODE_IE); #define IEEE80211_RSSI_GET(x) \ IEEE80211_RSSI_EP_RND(x, IEEE80211_RSSI_EP_MULTIPLIER) -static __inline struct ieee80211_node * -ieee80211_ref_node(struct ieee80211_node *ni) -{ - ieee80211_node_incref(ni); - return ni; -} - void ieee80211_node_attach(struct ieee80211com *); void ieee80211_node_lateattach(struct ieee80211com *); void ieee80211_node_detach(struct ieee80211com *); @@ -397,6 +390,8 @@ struct ieee80211_node *ieee80211_node_create_wds(struct ieee80211vap *, struct ieee80211_channel *); /* These functions are taking __func__, __LINE__ for IEEE80211_DEBUG_REFCNT */ +struct ieee80211_node *_ieee80211_ref_node(struct ieee80211_node *, + const char *func, int line); void _ieee80211_free_node(struct ieee80211_node *, const char *func, int line); struct ieee80211_node *_ieee80211_find_node_locked( @@ -426,6 +421,8 @@ struct ieee80211_node *_ieee80211_find_rxnode_withkey( struct ieee80211_node *_ieee80211_find_txnode(struct ieee80211vap *, const uint8_t macaddr[IEEE80211_ADDR_LEN], const char *func, int line); +#define ieee80211_ref_node(ni) \ + _ieee80211_ref_node(ni, __func__, __LINE__) #define ieee80211_free_node(ni) \ _ieee80211_free_node(ni, __func__, __LINE__) #define ieee80211_find_node_locked(nt, mac) \