summaryrefslogtreecommitdiffstats
path: root/net/mac80211/sta_info.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2015-06-16 16:22:12 +0200
committerJohannes Berg <johannes.berg@intel.com>2015-07-17 15:38:03 +0200
commitac100ce52a2d3b6261a06939d22e4382d9aa0bb2 (patch)
treeb61743db78d5d934803b70e73ce73a8eb035eded /net/mac80211/sta_info.c
parent981d94a80174e4f33bd5015fb49051bfc2eb00d2 (diff)
downloadlinux-ac100ce52a2d3b6261a06939d22e4382d9aa0bb2.tar.gz
linux-ac100ce52a2d3b6261a06939d22e4382d9aa0bb2.tar.xz
mac80211: duplicate station's MAC address for hash table
Currently, the station hash table lookup (or iteration) must access two cachelines for each station - the one with the hash table node, and the one with the MAC address. Duplicate the MAC address next to the hash node to get rid of this. Since the MAC address is static there's no consistency problem introduced by this. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/sta_info.c')
-rw-r--r--net/mac80211/sta_info.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 666ddac3c87c..d573a499750e 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -68,7 +68,7 @@ static const struct rhashtable_params sta_rht_params = {
.nelem_hint = 3, /* start small */
.automatic_shrinking = true,
.head_offset = offsetof(struct sta_info, hash_node),
- .key_offset = offsetof(struct sta_info, sta.addr),
+ .key_offset = offsetof(struct sta_info, addr),
.key_len = ETH_ALEN,
.hashfn = sta_addr_hash,
.max_size = CONFIG_MAC80211_STA_HASH_MAX_SIZE,
@@ -320,6 +320,7 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata,
sta->nonpeer_pm = NL80211_MESH_POWER_ACTIVE;
#endif
+ memcpy(sta->addr, addr, ETH_ALEN);
memcpy(sta->sta.addr, addr, ETH_ALEN);
sta->local = local;
sta->sdata = sdata;