Commit 82a39eb6 authored by Jozsef Kadlecsik's avatar Jozsef Kadlecsik Committed by David S. Miller

ipv6: Prepare the tree for un-inlined jhash.

jhash is widely used in the kernel and because the functions
are inlined, the cost in size is significant. Also, the new jhash
functions are slightly larger than the previous ones so better un-inline.
As a preparation step, the calls to the internal macros are replaced
with the plain jhash function calls.
Signed-off-by: default avatarJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent aa285b17
...@@ -60,18 +60,16 @@ EXPORT_SYMBOL_GPL(inet6_csk_bind_conflict); ...@@ -60,18 +60,16 @@ EXPORT_SYMBOL_GPL(inet6_csk_bind_conflict);
static u32 inet6_synq_hash(const struct in6_addr *raddr, const __be16 rport, static u32 inet6_synq_hash(const struct in6_addr *raddr, const __be16 rport,
const u32 rnd, const u16 synq_hsize) const u32 rnd, const u16 synq_hsize)
{ {
u32 a = (__force u32)raddr->s6_addr32[0]; u32 c;
u32 b = (__force u32)raddr->s6_addr32[1];
u32 c = (__force u32)raddr->s6_addr32[2]; c = jhash_3words((__force u32)raddr->s6_addr32[0],
(__force u32)raddr->s6_addr32[1],
a += JHASH_GOLDEN_RATIO; (__force u32)raddr->s6_addr32[2],
b += JHASH_GOLDEN_RATIO; rnd);
c += rnd;
__jhash_mix(a, b, c); c = jhash_2words((__force u32)raddr->s6_addr32[3],
(__force u32)rport,
a += (__force u32)raddr->s6_addr32[3]; c);
b += (__force u32)rport;
__jhash_mix(a, b, c);
return c & (synq_hsize - 1); return c & (synq_hsize - 1);
} }
......
...@@ -104,26 +104,22 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff *prev, ...@@ -104,26 +104,22 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff *prev,
unsigned int inet6_hash_frag(__be32 id, const struct in6_addr *saddr, unsigned int inet6_hash_frag(__be32 id, const struct in6_addr *saddr,
const struct in6_addr *daddr, u32 rnd) const struct in6_addr *daddr, u32 rnd)
{ {
u32 a, b, c; u32 c;
a = (__force u32)saddr->s6_addr32[0]; c = jhash_3words((__force u32)saddr->s6_addr32[0],
b = (__force u32)saddr->s6_addr32[1]; (__force u32)saddr->s6_addr32[1],
c = (__force u32)saddr->s6_addr32[2]; (__force u32)saddr->s6_addr32[2],
rnd);
a += JHASH_GOLDEN_RATIO;
b += JHASH_GOLDEN_RATIO; c = jhash_3words((__force u32)saddr->s6_addr32[3],
c += rnd; (__force u32)daddr->s6_addr32[0],
__jhash_mix(a, b, c); (__force u32)daddr->s6_addr32[1],
c);
a += (__force u32)saddr->s6_addr32[3];
b += (__force u32)daddr->s6_addr32[0]; c = jhash_3words((__force u32)daddr->s6_addr32[2],
c += (__force u32)daddr->s6_addr32[1]; (__force u32)daddr->s6_addr32[3],
__jhash_mix(a, b, c); (__force u32)id,
c);
a += (__force u32)daddr->s6_addr32[2];
b += (__force u32)daddr->s6_addr32[3];
c += (__force u32)id;
__jhash_mix(a, b, c);
return c & (INETFRAGS_HASHSZ - 1); return c & (INETFRAGS_HASHSZ - 1);
} }
......
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