Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9b88790972498d235a2a4d2b66640c3c5b70bb7c
Commit:     9b88790972498d235a2a4d2b66640c3c5b70bb7c
Parent:     8e87e014ec881ce353e1f43340157f519b5d9f30
Author:     Sami Farin <[EMAIL PROTECTED]>
AuthorDate: Wed Mar 14 16:43:00 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Apr 25 22:25:53 2007 -0700

    [NETFILTER]: nf_conntrack: use jhash2 in __hash_conntrack
    
    Now it uses jhash, but using jhash2 would be around 3-4 times faster
    (on P4).
    
    Signed-off-by: Sami Farin <[EMAIL PROTECTED]>
    Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/netfilter/nf_conntrack_core.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/net/netfilter/nf_conntrack_core.c 
b/net/netfilter/nf_conntrack_core.c
index 9858bcb..2b0cc7a 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -128,10 +128,11 @@ static u_int32_t __hash_conntrack(const struct 
nf_conntrack_tuple *tuple,
                                  unsigned int size, unsigned int rnd)
 {
        unsigned int a, b;
-       a = jhash((void *)tuple->src.u3.all, sizeof(tuple->src.u3.all),
-                 ((tuple->src.l3num) << 16) | tuple->dst.protonum);
-       b = jhash((void *)tuple->dst.u3.all, sizeof(tuple->dst.u3.all),
-                       (tuple->src.u.all << 16) | tuple->dst.u.all);
+
+       a = jhash2(tuple->src.u3.all, ARRAY_SIZE(tuple->src.u3.all),
+                  (tuple->src.l3num << 16) | tuple->dst.protonum);
+       b = jhash2(tuple->dst.u3.all, ARRAY_SIZE(tuple->dst.u3.all),
+                  (tuple->src.u.all << 16) | tuple->dst.u.all);
 
        return jhash_2words(a, b, rnd) % size;
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to