o replace ieee80211_node_reclaim by individual operations to release the

references to iv_bss and the sta table; this is equivalent and causes
  direct reclaim of the old bss node when any references in packets inflight
  are reclaimed (previously the old node would sit in the bss table until
  the inactivity processing reclaimed it)
o remove ieee80211_node_reclaim now that it's only use is gone

Reviewed by:	avatar, cbzimmer
This commit is contained in:
Sam Leffler 2009-02-12 23:34:58 +00:00
parent a43268a746
commit 47a7b0fa21

View File

@ -87,7 +87,6 @@ static void ieee80211_node_table_init(struct ieee80211com *ic,
int inact, int keymaxix);
static void ieee80211_node_table_reset(struct ieee80211_node_table *,
struct ieee80211vap *);
static void ieee80211_node_reclaim(struct ieee80211_node *);
static void ieee80211_node_table_cleanup(struct ieee80211_node_table *nt);
static void ieee80211_erp_timeout(struct ieee80211com *);
@ -674,7 +673,8 @@ ieee80211_sta_join1(struct ieee80211_node *selbs)
vap->iv_bss = selbs; /* NB: caller assumed to bump refcnt */
if (obss != NULL) {
copy_bss(selbs, obss);
ieee80211_node_reclaim(obss);
ieee80211_node_decref(obss); /* iv_bss reference */
ieee80211_free_node(obss); /* station table reference */
obss = NULL; /* NB: guard against later use */
}
@ -1738,64 +1738,6 @@ node_reclaim(struct ieee80211_node_table *nt, struct ieee80211_node *ni)
_ieee80211_free_node(ni);
}
/*
* Reclaim a (bss) node. Decrement the refcnt and reclaim
* the node if the only other reference to it is in the sta
* table. This is effectively ieee80211_free_node followed
* by node_reclaim when the refcnt is 1 (after the free).
*/
static void
ieee80211_node_reclaim(struct ieee80211_node *ni)
{
struct ieee80211_node_table *nt = ni->ni_table;
KASSERT(nt != NULL, ("reclaim node not in table"));
#ifdef IEEE80211_DEBUG_REFCNT
IEEE80211_DPRINTF(ni->ni_vap, IEEE80211_MSG_NODE,
"%s %p<%s> refcnt %d\n", __func__, ni,
ether_sprintf(ni->ni_macaddr), ieee80211_node_refcnt(ni)-1);
#endif
IEEE80211_NODE_LOCK(nt);
if (ieee80211_node_dectestref(ni)) {
/*
* Last reference, reclaim state.
*/
_ieee80211_free_node(ni);
nt = NULL;
} else if (ieee80211_node_refcnt(ni) == 1 && nt->nt_keyixmap != NULL) {
ieee80211_keyix keyix;
/*
* Check for a last reference in the key mapping table.
*/
keyix = ni->ni_ucastkey.wk_rxkeyix;
if (keyix < nt->nt_keyixmax &&
nt->nt_keyixmap[keyix] == ni) {
IEEE80211_DPRINTF(ni->ni_vap,
IEEE80211_MSG_NODE,
"%s: %p<%s> clear key map entry %u", __func__,
ni, ether_sprintf(ni->ni_macaddr), keyix);
nt->nt_keyixmap[keyix] = NULL;
ieee80211_node_decref(ni); /* XXX needed? */
_ieee80211_free_node(ni);
nt = NULL;
}
}
if (nt != NULL && ieee80211_node_refcnt(ni) == 1) {
/*
* Last reference is in the sta table; complete
* the reclaim. This handles bss nodes being
* recycled: the node has two references, one for
* iv_bss and one for the table. After dropping
* the iv_bss ref above we need to reclaim the sta
* table reference.
*/
ieee80211_node_decref(ni); /* NB: be pendantic */
_ieee80211_free_node(ni);
}
IEEE80211_NODE_UNLOCK(nt);
}
/*
* Node table support.
*/