From patchwork Fri Apr 1 21:13:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Greear X-Patchwork-Id: 8727851 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E4D47C0553 for ; Fri, 1 Apr 2016 21:13:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 162A1203A1 for ; Fri, 1 Apr 2016 21:13:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3294320148 for ; Fri, 1 Apr 2016 21:13:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753660AbcDAVNg (ORCPT ); Fri, 1 Apr 2016 17:13:36 -0400 Received: from mail2.candelatech.com ([208.74.158.173]:48256 "EHLO mail2.candelatech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751093AbcDAVNg (ORCPT ); Fri, 1 Apr 2016 17:13:36 -0400 Received: from ben-dt3.candelatech.com (firewall.candelatech.com [50.251.239.81]) by mail2.candelatech.com (Postfix) with ESMTP id 7E5F040EB47; Fri, 1 Apr 2016 14:13:35 -0700 (PDT) From: greearb@candelatech.com To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net, Ben Greear Subject: [PATCH] mac80211: Ensure no limits on station rhashtable. Date: Fri, 1 Apr 2016 14:13:31 -0700 Message-Id: <1459545211-11517-1-git-send-email-greearb@candelatech.com> X-Mailer: git-send-email 2.4.3 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ben Greear 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 --- 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);