Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 315437
b: refs/heads/master
c: d3a25c9
h: refs/heads/master
i:
  315435: 6ef5e07
v: v3
  • Loading branch information
David S. Miller committed Jul 17, 2012
1 parent 57fe066 commit 4a3eabf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a6ff1a2f1e91578860b37df9fd861ef7af207de4
refs/heads/master: d3a25c980fc231238256f8d80816367674e5caaf
16 changes: 12 additions & 4 deletions trunk/net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -1347,6 +1347,16 @@ static struct fib_nh_exception *fnhe_oldest(struct fnhe_hash_bucket *hash, __be3
return oldest;
}

static inline u32 fnhe_hashfun(__be32 daddr)
{
u32 hval;

hval = (__force u32) daddr;
hval ^= (hval >> 11) ^ (hval >> 22);

return hval & (FNHE_HASH_SIZE - 1);
}

static struct fib_nh_exception *find_or_create_fnhe(struct fib_nh *nh, __be32 daddr)
{
struct fnhe_hash_bucket *hash = nh->nh_exceptions;
Expand All @@ -1361,8 +1371,7 @@ static struct fib_nh_exception *find_or_create_fnhe(struct fib_nh *nh, __be32 da
return NULL;
}

hval = (__force u32) daddr;
hval ^= (hval >> 11) ^ (hval >> 22);
hval = fnhe_hashfun(daddr);
hash += hval;

depth = 0;
Expand Down Expand Up @@ -1890,8 +1899,7 @@ static void rt_bind_exception(struct rtable *rt, struct fib_nh *nh, __be32 daddr
struct fib_nh_exception *fnhe;
u32 hval;

hval = (__force u32) daddr;
hval ^= (hval >> 11) ^ (hval >> 22);
hval = fnhe_hashfun(daddr);

for (fnhe = rcu_dereference(hash[hval].chain); fnhe;
fnhe = rcu_dereference(fnhe->fnhe_next)) {
Expand Down

0 comments on commit 4a3eabf

Please sign in to comment.