Skip to contentSkip to conversation

mac80211: Ensure no limits on station rhashtable.

PATCH Applied [email protected] 2 participants 2 messages Apr 1, 2016 – Apr 5, 2016 mac80211

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mac80211: Ensure no limits on station rhashtable.

From: Ben Greear <[email protected]>

By default, the rhashtable logic will fail to insert objects if the key-chains are too long and un-balanced.

In the degenerate case where mac80211 is creating many station vdevs connected to the same peer, this case can be hit.

So, set insecure_elasticity to true to allow chains to grow as long as needed.

---
 net/mac80211/sta_info.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
net/mac80211/sta_info.c +5 -1
index 38ef0be..c25b945 100644
@@ -66,6 +66,7 @@
 
 static const struct rhashtable_params sta_rht_params = {
 	.nelem_hint = 3, /* start small */
+	.insecure_elasticity = true, /* Disable chain-length checks. */
 	.automatic_shrinking = true,
 	.head_offset = offsetof(struct sta_info, hash_node),
 	.key_offset = offsetof(struct sta_info, addr),
@@ -322,8 +323,11 @@ static int sta_info_hash_add(struct ieee80211_local *local,
 
 	rv = rhashtable_insert_fast(&local->sta_hash, &sta->hash_node,
 				    sta_rht_params);
-	if (rv != 0)
+	if (rv != 0) {
+		pr_err("Failed to insert sta %pM in rhashtable, idx: %d  err: %d\n",
+		       sta->sta.addr, idx, rv);
 		return rv;
+	}
 
 	sta->vnext = sta->sdata->sta_vhash[idx];
 	rcu_assign_pointer(sta->sdata->sta_vhash[idx], sta);
Signature · 1 line
2.4.3
maintainer Applied
#1 lore raw
Quoted 5 lines · On Fri, 2016-04-01 at 14:13 -0700, [email protected] wrote:

From: Ben Greear <[email protected]>

By default, the rhashtable logic will fail to insert objects if the key-chains are too long and un-balanced.

Quoted 7 lines

In the degenerate case where mac80211 is creating many station vdevs connected to the same peer, this case can be hit.

So, set insecure_elasticity to true to allow chains to grow as long as needed.

Applied.

johannes