From 07f4195f6980dbfe29406619b7ac525b93b99ffb Mon Sep 17 00:00:00 2001 From: Dave Taht Date: Wed, 17 Jun 2015 12:11:45 -0700 Subject: [PATCH] hacked to more or less support netnext-4.2 change in flow apis This just gets sch_cake to compile and disable's several flow models. The new API is in flux and changing rapidly... recently landed was mpls and macaddr support, for example. --- sch_cake.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sch_cake.c b/sch_cake.c index 80e1cb2..aa357be 100644 --- a/sch_cake.c +++ b/sch_cake.c @@ -49,8 +49,11 @@ #include #include #include +#include #include "pkt_sched.h" +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0) #include +#endif #include "codel5.h" /* The CAKE Principle: @@ -205,12 +208,16 @@ enum { static inline unsigned int cake_fqcd_hash(struct cake_fqcd_sched_data *q, const struct sk_buff *skb, int flow_mode) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0) struct flow_keys keys; +#endif u32 hash, reduced_hash; if(unlikely(flow_mode == CAKE_FLOW_NONE || q->flows_cnt < CAKE_SET_WAYS)) return 0; + +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0) skb_flow_dissect(skb, &keys); if(flow_mode != CAKE_FLOW_ALL) { @@ -227,7 +234,9 @@ cake_fqcd_hash(struct cake_fqcd_sched_data *q, const struct sk_buff *skb, int fl hash = jhash_3words((__force u32)keys.dst, (__force u32)keys.src ^ keys.ip_proto, (__force u32)keys.ports, q->perturbation); - +#else + hash = skb_get_hash_perturb(skb, q->perturbation); +#endif reduced_hash = reciprocal_scale(hash, q->flows_cnt); // set-associative hashing -- 2.1.0