neigh: Store hash shift instead of mask.
And mask the hash function result by simply shifting down the "->hash_shift" most significant bits. Currently which bits we use is arbitrary since jhash produces entropy evenly across the whole hash function result. But soon we'll be using universal hashing functions, and in those cases more entropy exists in the higher bits than the lower bits, because they use multiplies. Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
@@ -142,7 +142,7 @@ struct pneigh_entry {
|
||||
|
||||
struct neigh_hash_table {
|
||||
struct neighbour __rcu **hash_buckets;
|
||||
unsigned int hash_mask;
|
||||
unsigned int hash_shift;
|
||||
__u32 hash_rnd;
|
||||
struct rcu_head rcu;
|
||||
};
|
||||
|
Reference in New Issue
Block a user