Commit 342db221 authored by Tom Herbert's avatar Tom Herbert Committed by David S. Miller

sched: Call skb_get_hash_perturb in sch_fq_codel

Call skb_get_hash_perturb instead of doing skb_flow_dissect and then
jhash by hand.
Signed-off-by: default avatarTom Herbert <tom@herbertland.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 50fb7992
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <net/netlink.h> #include <net/netlink.h>
#include <net/pkt_sched.h> #include <net/pkt_sched.h>
#include <net/flow_keys.h>
#include <net/codel.h> #include <net/codel.h>
/* Fair Queue CoDel. /* Fair Queue CoDel.
...@@ -68,15 +67,9 @@ struct fq_codel_sched_data { ...@@ -68,15 +67,9 @@ struct fq_codel_sched_data {
}; };
static unsigned int fq_codel_hash(const struct fq_codel_sched_data *q, 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; u32 hash = skb_get_hash_perturb(skb, q->perturbation);
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);
return reciprocal_scale(hash, q->flows_cnt); return reciprocal_scale(hash, q->flows_cnt);
} }
......
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