diff mbox

mac80211: Ensure no limits on station rhashtable.

Message ID 1459545211-11517-1-git-send-email-greearb@candelatech.com (mailing list archive)
State Accepted
Delegated to: Johannes Berg
Headers show

Commit Message

Ben Greear April 1, 2016, 9:13 p.m. UTC
From: Ben Greear <greearb@candelatech.com>

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.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
 net/mac80211/sta_info.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Johannes Berg April 5, 2016, 9:08 a.m. UTC | #1
On Fri, 2016-04-01 at 14:13 -0700, greearb@candelatech.com wrote:
> From: Ben Greear <greearb@candelatech.com>
> 
> 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.
> 
Applied.

johannes
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 38ef0be..c25b945 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -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);