diff options
author | Eric Dumazet <edumazet@google.com> | 2013-02-15 13:14:48 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-02-18 12:23:51 -0500 |
commit | 279e9f2ff7351a7908f964332e778049712cbd5b (patch) | |
tree | 182352c3facc2d15330d38db67930431685424cd /net/ipv6 | |
parent | c8c5b287152bfd10c27390d36df2a8131cf906f5 (diff) |
ipv6: optimize inet6_hash_frag()
Use ipv6_addr_hash() and a single jhash invocation.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/reassembly.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c index e354743ed426..9a6428aaa2d8 100644 --- a/net/ipv6/reassembly.c +++ b/net/ipv6/reassembly.c | |||
@@ -79,20 +79,7 @@ unsigned int inet6_hash_frag(__be32 id, const struct in6_addr *saddr, | |||
79 | { | 79 | { |
80 | u32 c; | 80 | u32 c; |
81 | 81 | ||
82 | c = jhash_3words((__force u32)saddr->s6_addr32[0], | 82 | c = jhash_3words(ipv6_addr_hash(saddr), ipv6_addr_hash(daddr), id, rnd); |
83 | (__force u32)saddr->s6_addr32[1], | ||
84 | (__force u32)saddr->s6_addr32[2], | ||
85 | rnd); | ||
86 | |||
87 | c = jhash_3words((__force u32)saddr->s6_addr32[3], | ||
88 | (__force u32)daddr->s6_addr32[0], | ||
89 | (__force u32)daddr->s6_addr32[1], | ||
90 | c); | ||
91 | |||
92 | c = jhash_3words((__force u32)daddr->s6_addr32[2], | ||
93 | (__force u32)daddr->s6_addr32[3], | ||
94 | (__force u32)id, | ||
95 | c); | ||
96 | 83 | ||
97 | return c & (INETFRAGS_HASHSZ - 1); | 84 | return c & (INETFRAGS_HASHSZ - 1); |
98 | } | 85 | } |