summaryrefslogtreecommitdiff
path: root/patches
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2014-02-10 23:24:41 +0100
committerHauke Mehrtens <hauke@hauke-m.de>2014-02-10 23:30:41 +0100
commit6399aaa1cf1ce4fe45756e481a5d702c90e22b04 (patch)
treec514bc13156eac851150697d67111fac48bfdba1 /patches
parente4e34a387951a2ecb6de01175c3c2585f57bab3f (diff)
backports: copy sch_codel.c from kernel
Instead of using an own version of sch_codel.c make backports copy that code from the kernel and use that. This ensures that we will always use the latest version. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Diffstat (limited to 'patches')
-rw-r--r--patches/backport-adjustments/sch_codel.patch98
1 files changed, 98 insertions, 0 deletions
diff --git a/patches/backport-adjustments/sch_codel.patch b/patches/backport-adjustments/sch_codel.patch
new file mode 100644
index 00000000..c6d6618a
--- /dev/null
+++ b/patches/backport-adjustments/sch_codel.patch
@@ -0,0 +1,98 @@
+--- a/compat/net-sched-sch_codel.c
++++ b/compat/net-sched-sch_codel.c
+@@ -58,6 +58,9 @@ struct codel_sched_data {
+ struct codel_vars vars;
+ struct codel_stats stats;
+ u32 drop_overlimit;
++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,39))
++ u32 limit;
++#endif
+ };
+
+ /* This is the specific function called from codel_dequeue()
+@@ -95,11 +98,16 @@ static int codel_qdisc_enqueue(struct sk
+ {
+ struct codel_sched_data *q;
+
++ q = qdisc_priv(sch);
++
++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,39))
++ if (likely(qdisc_qlen(sch) < q->limit)) {
++#else
+ if (likely(qdisc_qlen(sch) < sch->limit)) {
++#endif
+ codel_set_enqueue_time(skb);
+ return qdisc_enqueue_tail(skb, sch);
+ }
+- q = qdisc_priv(sch);
+ q->drop_overlimit++;
+ return qdisc_drop(skb, sch);
+ }
+@@ -140,13 +148,21 @@ static int codel_change(struct Qdisc *sc
+ }
+
+ if (tb[TCA_CODEL_LIMIT])
++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,39))
++ q->limit = nla_get_u32(tb[TCA_CODEL_LIMIT]);
++#else
+ sch->limit = nla_get_u32(tb[TCA_CODEL_LIMIT]);
++#endif
+
+ if (tb[TCA_CODEL_ECN])
+ q->params.ecn = !!nla_get_u32(tb[TCA_CODEL_ECN]);
+
+ qlen = sch->q.qlen;
++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,39))
++ while (sch->q.qlen > q->limit) {
++#else
+ while (sch->q.qlen > sch->limit) {
++#endif
+ struct sk_buff *skb = __skb_dequeue(&sch->q);
+
+ sch->qstats.backlog -= qdisc_pkt_len(skb);
+@@ -162,7 +178,11 @@ static int codel_init(struct Qdisc *sch,
+ {
+ struct codel_sched_data *q = qdisc_priv(sch);
+
++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,39))
++ q->limit = DEFAULT_CODEL_LIMIT;
++#else
+ sch->limit = DEFAULT_CODEL_LIMIT;
++#endif
+
+ codel_params_init(&q->params);
+ codel_vars_init(&q->vars);
+@@ -175,7 +195,11 @@ static int codel_init(struct Qdisc *sch,
+ return err;
+ }
+
++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,39))
++ if (q->limit >= 1)
++#else
+ if (sch->limit >= 1)
++#endif
+ sch->flags |= TCQ_F_CAN_BYPASS;
+ else
+ sch->flags &= ~TCQ_F_CAN_BYPASS;
+@@ -195,7 +219,11 @@ static int codel_dump(struct Qdisc *sch,
+ if (nla_put_u32(skb, TCA_CODEL_TARGET,
+ codel_time_to_us(q->params.target)) ||
+ nla_put_u32(skb, TCA_CODEL_LIMIT,
++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,39))
++ q->limit) ||
++#else
+ sch->limit) ||
++#endif
+ nla_put_u32(skb, TCA_CODEL_INTERVAL,
+ codel_time_to_us(q->params.interval)) ||
+ nla_put_u32(skb, TCA_CODEL_ECN,
+@@ -248,7 +276,9 @@ static struct Qdisc_ops codel_qdisc_ops
+
+ .enqueue = codel_qdisc_enqueue,
+ .dequeue = codel_qdisc_dequeue,
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,28))
+ .peek = qdisc_peek_dequeued,
++#endif
+ .init = codel_init,
+ .reset = codel_reset,
+ .change = codel_change,