tcp: replace ehash_size by ehash_mask
Storing the mask (size - 1) instead of the size allows fast path to be a bit faster. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
c3faca053d
commit
f373b53b5f
@@ -209,7 +209,7 @@ struct sock * __inet_lookup_established(struct net *net,
|
||||
* have wildcards anyways.
|
||||
*/
|
||||
unsigned int hash = inet_ehashfn(net, daddr, hnum, saddr, sport);
|
||||
unsigned int slot = hash & (hashinfo->ehash_size - 1);
|
||||
unsigned int slot = hash & hashinfo->ehash_mask;
|
||||
struct inet_ehash_bucket *head = &hashinfo->ehash[slot];
|
||||
|
||||
rcu_read_lock();
|
||||
|
Reference in New Issue
Block a user