@@ -177,12 +177,10 @@ static int mesh_table_grow(struct mesh_table *oldtbl,
177
177
return - ENOMEM ;
178
178
}
179
179
180
- static u32 mesh_table_hash (const u8 * addr , struct ieee80211_sub_if_data * sdata ,
181
- struct mesh_table * tbl )
180
+ static u32 mesh_table_hash (const u8 * addr , struct mesh_table * tbl )
182
181
{
183
- /* Use last four bytes of hw addr and interface index as hash index */
184
- return jhash_2words (* (u32 * )(addr + 2 ), sdata -> dev -> ifindex ,
185
- tbl -> hash_rnd ) & tbl -> hash_mask ;
182
+ /* Use last four bytes of hw addr as hash index */
183
+ return jhash_1word (* (u32 * )(addr + 2 ), tbl -> hash_rnd ) & tbl -> hash_mask ;
186
184
}
187
185
188
186
@@ -331,7 +329,7 @@ static struct mesh_path *mpath_lookup(struct mesh_table *tbl, const u8 *dst,
331
329
struct hlist_head * bucket ;
332
330
struct mpath_node * node ;
333
331
334
- bucket = & tbl -> hash_buckets [mesh_table_hash (dst , sdata , tbl )];
332
+ bucket = & tbl -> hash_buckets [mesh_table_hash (dst , tbl )];
335
333
hlist_for_each_entry_rcu (node , bucket , list ) {
336
334
mpath = node -> mpath ;
337
335
if (ether_addr_equal (dst , mpath -> dst )) {
@@ -538,7 +536,7 @@ struct mesh_path *mesh_path_add(struct ieee80211_sub_if_data *sdata,
538
536
read_lock_bh (& sdata -> u .mesh .pathtbl_resize_lock );
539
537
tbl = resize_dereference_mesh_paths (sdata );
540
538
541
- hash_idx = mesh_table_hash (dst , sdata , tbl );
539
+ hash_idx = mesh_table_hash (dst , tbl );
542
540
bucket = & tbl -> hash_buckets [hash_idx ];
543
541
544
542
spin_lock (& tbl -> hashwlock [hash_idx ]);
@@ -687,7 +685,7 @@ int mpp_path_add(struct ieee80211_sub_if_data *sdata,
687
685
688
686
tbl = resize_dereference_mpp_paths (sdata );
689
687
690
- hash_idx = mesh_table_hash (dst , sdata , tbl );
688
+ hash_idx = mesh_table_hash (dst , tbl );
691
689
bucket = & tbl -> hash_buckets [hash_idx ];
692
690
693
691
spin_lock (& tbl -> hashwlock [hash_idx ]);
@@ -905,7 +903,7 @@ static int table_path_del(struct mesh_table __rcu *rcu_tbl,
905
903
int err = 0 ;
906
904
907
905
tbl = resize_dereference_paths (sdata , rcu_tbl );
908
- hash_idx = mesh_table_hash (addr , sdata , tbl );
906
+ hash_idx = mesh_table_hash (addr , tbl );
909
907
bucket = & tbl -> hash_buckets [hash_idx ];
910
908
911
909
spin_lock (& tbl -> hashwlock [hash_idx ]);
@@ -1107,7 +1105,7 @@ static int mesh_path_node_copy(struct hlist_node *p, struct mesh_table *newtbl)
1107
1105
node = hlist_entry (p , struct mpath_node , list );
1108
1106
mpath = node -> mpath ;
1109
1107
new_node -> mpath = mpath ;
1110
- hash_idx = mesh_table_hash (mpath -> dst , mpath -> sdata , newtbl );
1108
+ hash_idx = mesh_table_hash (mpath -> dst , newtbl );
1111
1109
hlist_add_head (& new_node -> list ,
1112
1110
& newtbl -> hash_buckets [hash_idx ]);
1113
1111
return 0 ;
0 commit comments