summaryrefslogtreecommitdiffstats
path: root/sys/net80211
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2013-06-07 09:03:56 +0000
committeradrian <adrian@FreeBSD.org>2013-06-07 09:03:56 +0000
commitc7b7fe134deed560685984129b31c899459c6356 (patch)
treebe5f4490c44cb2ed89403fe08d767ed41db49970 /sys/net80211
parentd4f88869bd5342309ce0763576a1e4fa222708db (diff)
downloadFreeBSD-src-c7b7fe134deed560685984129b31c899459c6356.zip
FreeBSD-src-c7b7fe134deed560685984129b31c899459c6356.tar.gz
Don't hold the node lock over the iterator.
The "find node" function call will increase the node reference anyway; so there's no reason to hold the node table lock during the MLME change. The only reason I could think of is to stop overlapping mlme ioctls from causing issues, but this should be fixed a different way. This fixes a whole class of LORs that creep up when nodes are being timed out or removed by hostapd. Tested: * AR5416, hostap, with nodes coming and going. No LORs or stability issues were observed.
Diffstat (limited to 'sys/net80211')
-rw-r--r--sys/net80211/ieee80211_ioctl.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/sys/net80211/ieee80211_ioctl.c b/sys/net80211/ieee80211_ioctl.c
index 4118c57..9f58754 100644
--- a/sys/net80211/ieee80211_ioctl.c
+++ b/sys/net80211/ieee80211_ioctl.c
@@ -1340,12 +1340,17 @@ setmlme_dropsta(struct ieee80211vap *vap,
if (!IEEE80211_ADDR_EQ(mac, ic->ic_ifp->if_broadcastaddr)) {
IEEE80211_NODE_LOCK(nt);
ni = ieee80211_find_node_locked(nt, mac);
+ IEEE80211_NODE_UNLOCK(nt);
+ /*
+ * Don't do the node update inside the node
+ * table lock. This unfortunately causes LORs
+ * with drivers and their TX paths.
+ */
if (ni != NULL) {
domlme(mlmeop, ni);
ieee80211_free_node(ni);
} else
error = ENOENT;
- IEEE80211_NODE_UNLOCK(nt);
} else {
ieee80211_iterate_nodes(nt, domlme, mlmeop);
}
@@ -1400,13 +1405,18 @@ setmlme_common(struct ieee80211vap *vap, int op,
case IEEE80211_M_MBSS:
IEEE80211_NODE_LOCK(nt);
ni = ieee80211_find_node_locked(nt, mac);
+ /*
+ * Don't do the node update inside the node
+ * table lock. This unfortunately causes LORs
+ * with drivers and their TX paths.
+ */
+ IEEE80211_NODE_UNLOCK(nt);
if (ni != NULL) {
ieee80211_node_leave(ni);
ieee80211_free_node(ni);
} else {
error = ENOENT;
}
- IEEE80211_NODE_UNLOCK(nt);
break;
default:
error = EINVAL;
@@ -1422,6 +1432,12 @@ setmlme_common(struct ieee80211vap *vap, int op,
}
IEEE80211_NODE_LOCK(nt);
ni = ieee80211_find_vap_node_locked(nt, vap, mac);
+ /*
+ * Don't do the node update inside the node
+ * table lock. This unfortunately causes LORs
+ * with drivers and their TX paths.
+ */
+ IEEE80211_NODE_UNLOCK(nt);
if (ni != NULL) {
mlmedebug(vap, mac, op, reason);
if (op == IEEE80211_MLME_AUTHORIZE)
@@ -1431,7 +1447,6 @@ setmlme_common(struct ieee80211vap *vap, int op,
ieee80211_free_node(ni);
} else
error = ENOENT;
- IEEE80211_NODE_UNLOCK(nt);
break;
case IEEE80211_MLME_AUTH:
if (vap->iv_opmode != IEEE80211_M_HOSTAP) {
@@ -1440,6 +1455,12 @@ setmlme_common(struct ieee80211vap *vap, int op,
}
IEEE80211_NODE_LOCK(nt);
ni = ieee80211_find_vap_node_locked(nt, vap, mac);
+ /*
+ * Don't do the node update inside the node
+ * table lock. This unfortunately causes LORs
+ * with drivers and their TX paths.
+ */
+ IEEE80211_NODE_UNLOCK(nt);
if (ni != NULL) {
mlmedebug(vap, mac, op, reason);
if (reason == IEEE80211_STATUS_SUCCESS) {
@@ -1463,7 +1484,6 @@ setmlme_common(struct ieee80211vap *vap, int op,
ieee80211_free_node(ni);
} else
error = ENOENT;
- IEEE80211_NODE_UNLOCK(nt);
break;
default:
error = EINVAL;
OpenPOWER on IntegriCloud