git: 24df98cc9d9d - stable/14 - net80211: de-inline ieee80211_ref_node()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 30 Nov 2023 00:38:12 UTC
The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=24df98cc9d9dce1b6b3d47d340f9eb77445d2d2c commit 24df98cc9d9dce1b6b3d47d340f9eb77445d2d2c Author: Bjoern A. Zeeb <bz@FreeBSD.org> AuthorDate: 2023-10-02 20:20:14 +0000 Commit: Bjoern A. Zeeb <bz@FreeBSD.org> CommitDate: 2023-11-30 00:36:57 +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 (cherry picked from commit 2188852196151e5f04533eaa928a7ad0896e4bd6) --- 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 826ecccb1238..67ad4a7c44f6 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; -} - static __inline void ieee80211_unref_node(struct ieee80211_node **ni) { @@ -404,6 +397,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( @@ -433,6 +428,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) \