Commit b6b556af authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

ipv6: use jhash2() in rt6_exception_hash()

Faster jhash2() can be used instead of jhash(), since
IPv6 addresses have the needed alignment requirement.
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0c65b2b9
...@@ -1475,11 +1475,11 @@ static u32 rt6_exception_hash(const struct in6_addr *dst, ...@@ -1475,11 +1475,11 @@ static u32 rt6_exception_hash(const struct in6_addr *dst,
u32 val; u32 val;
net_get_random_once(&seed, sizeof(seed)); net_get_random_once(&seed, sizeof(seed));
val = jhash(dst, sizeof(*dst), seed); val = jhash2((const u32 *)dst, sizeof(*dst)/sizeof(u32), seed);
#ifdef CONFIG_IPV6_SUBTREES #ifdef CONFIG_IPV6_SUBTREES
if (src) if (src)
val = jhash(src, sizeof(*src), val); val = jhash2((const u32 *)src, sizeof(*src)/sizeof(u32), val);
#endif #endif
return hash_32(val, FIB6_EXCEPTION_BUCKET_SIZE_SHIFT); return hash_32(val, FIB6_EXCEPTION_BUCKET_SIZE_SHIFT);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment