]> git.baikalelectronics.ru Git - kernel.git/commit
neigh: Store hash shift instead of mask.
authorDavid S. Miller <davem@davemloft.net>
Mon, 11 Jul 2011 08:28:12 +0000 (01:28 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 11 Jul 2011 08:28:12 +0000 (01:28 -0700)
commit80d59d9f5eacf5c9cf87f1234dddce17bac098ed
treee2f46e4b4270c7403a895339df93d9bbefb7c363
parenta0bd4f154a356e007bb3c01e9ada580965e401e9
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>
include/net/neighbour.h
net/core/neighbour.c