Commit 1126996a authored by Herbert Xu's avatar Herbert Xu Committed by David S. Miller

[XFRM]: Kill unused flow_hash

This patch removes a left-over from the days when the flow cache lived
in xfrm_policy.c.
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarDavid S. Miller <davem@redhat.com>
parent 592b64d7
......@@ -304,47 +304,6 @@ extern int xfrm_register_km(struct xfrm_mgr *km);
extern int xfrm_unregister_km(struct xfrm_mgr *km);
#define XFRM_FLOWCACHE_HASH_SIZE 1024
static inline u32 __flow_hash4(struct flowi *fl)
{
u32 hash = fl->fl4_src ^ fl->fl_ip_sport;
hash = ((hash & 0xF0F0F0F0) >> 4) | ((hash & 0x0F0F0F0F) << 4);
hash ^= fl->fl4_dst ^ fl->fl_ip_dport;
hash ^= (hash >> 10);
hash ^= (hash >> 20);
return hash & (XFRM_FLOWCACHE_HASH_SIZE-1);
}
static inline u32 __flow_hash6(struct flowi *fl)
{
u32 hash = fl->fl6_src.s6_addr32[2] ^
fl->fl6_src.s6_addr32[3] ^
fl->fl_ip_sport;
hash = ((hash & 0xF0F0F0F0) >> 4) | ((hash & 0x0F0F0F0F) << 4);
hash ^= fl->fl6_dst.s6_addr32[2] ^
fl->fl6_dst.s6_addr32[3] ^
fl->fl_ip_dport;
hash ^= (hash >> 10);
hash ^= (hash >> 20);
return hash & (XFRM_FLOWCACHE_HASH_SIZE-1);
}
static inline u32 flow_hash(struct flowi *fl, unsigned short family)
{
switch (family) {
case AF_INET:
return __flow_hash4(fl);
case AF_INET6:
return __flow_hash6(fl);
}
return 0; /*XXX*/
}
extern struct xfrm_policy *xfrm_policy_list[XFRM_POLICY_MAX*2];
static inline void xfrm_pol_hold(struct xfrm_policy *policy)
......
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