linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211:  Ensure no limits on station rhashtable.
@ 2016-04-01 21:13 greearb
  2016-04-05  9:08 ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: greearb @ 2016-04-01 21:13 UTC (permalink / raw)
  To: linux-wireless; +Cc: johannes, Ben Greear

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(-)

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);
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mac80211:  Ensure no limits on station rhashtable.
  2016-04-01 21:13 [PATCH] mac80211: Ensure no limits on station rhashtable greearb
@ 2016-04-05  9:08 ` Johannes Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2016-04-05  9:08 UTC (permalink / raw)
  To: greearb, linux-wireless

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-04-05  9:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-01 21:13 [PATCH] mac80211: Ensure no limits on station rhashtable greearb
2016-04-05  9:08 ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).