sched: Call skb_get_hash_perturb in sch_fq_codel
authorTom Herbert <tom@herbertland.com>
Fri, 1 May 2015 18:30:13 +0000 (11:30 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 4 May 2015 04:09:08 +0000 (00:09 -0400)
Call skb_get_hash_perturb instead of doing skb_flow_dissect and then
jhash by hand.

Signed-off-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_fq_codel.c

index 1e52decb7b59cf0b4173d0f17efdab8fefee5f26..a6fc53d69513baa3578e6b73a7947ae1dee8ee0c 100644 (file)
@@ -23,7 +23,6 @@
 #include <linux/vmalloc.h>
 #include <net/netlink.h>
 #include <net/pkt_sched.h>
-#include <net/flow_keys.h>
 #include <net/codel.h>
 
 /*     Fair Queue CoDel.
@@ -68,15 +67,9 @@ struct fq_codel_sched_data {
 };
 
 static unsigned int fq_codel_hash(const struct fq_codel_sched_data *q,
-                                 const struct sk_buff *skb)
+                                 struct sk_buff *skb)
 {
-       struct flow_keys keys;
-       unsigned int hash;
-
-       skb_flow_dissect(skb, &keys);
-       hash = jhash_3words((__force u32)keys.dst,
-                           (__force u32)keys.src ^ keys.ip_proto,
-                           (__force u32)keys.ports, q->perturbation);
+       u32 hash = skb_get_hash_perturb(skb, q->perturbation);
 
        return reciprocal_scale(hash, q->flows_cnt);
 }