summaryrefslogtreecommitdiffstats
path: root/net/mac80211/rx.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2016-09-19 07:00:10 -0400
committerDavid S. Miller <davem@davemloft.net>2016-09-20 04:43:36 -0400
commit83e7e4ce9e93c3b020497144f4354b62aed5d894 (patch)
tree946fbe77a562eb44d6533660d206a6141406d664 /net/mac80211/rx.c
parentca26893f05e86497a86732768ec53cd38c0819ca (diff)
mac80211: Use rhltable instead of rhashtable
mac80211 currently uses rhashtable with insecure_elasticity set to true. The latter is because of duplicate objects. What's more, mac80211 walks the rhashtable chains by hand which is broken as rhashtable may contain multiple tables due to resizing or rehashing. This patch fixes it by converting it to the newly added rhltable interface which is designed for use with duplicate objects. With rhltable a lookup returns a list of objects instead of a single one. This is then fed into the existing for_each_sta_info macro. This patch also deletes the sta_addr_hash function since rhashtable defaults to jhash. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mac80211/rx.c')
-rw-r--r--net/mac80211/rx.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index e796060b7c5e..f7cf342bab52 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -4003,7 +4003,7 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw,
4003 __le16 fc; 4003 __le16 fc;
4004 struct ieee80211_rx_data rx; 4004 struct ieee80211_rx_data rx;
4005 struct ieee80211_sub_if_data *prev; 4005 struct ieee80211_sub_if_data *prev;
4006 struct rhash_head *tmp; 4006 struct rhlist_head *tmp;
4007 int err = 0; 4007 int err = 0;
4008 4008
4009 fc = ((struct ieee80211_hdr *)skb->data)->frame_control; 4009 fc = ((struct ieee80211_hdr *)skb->data)->frame_control;
@@ -4046,13 +4046,10 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw,
4046 goto out; 4046 goto out;
4047 } else if (ieee80211_is_data(fc)) { 4047 } else if (ieee80211_is_data(fc)) {
4048 struct sta_info *sta, *prev_sta; 4048 struct sta_info *sta, *prev_sta;
4049 const struct bucket_table *tbl;
4050 4049
4051 prev_sta = NULL; 4050 prev_sta = NULL;
4052 4051
4053 tbl = rht_dereference_rcu(local->sta_hash.tbl, &local->sta_hash); 4052 for_each_sta_info(local, hdr->addr2, sta, tmp) {
4054
4055 for_each_sta_info(local, tbl, hdr->addr2, sta, tmp) {
4056 if (!prev_sta) { 4053 if (!prev_sta) {
4057 prev_sta = sta; 4054 prev_sta = sta;
4058 continue; 4055 continue;