kernel: bump 4.9 to 4.9.57
[openwrt/staging/chunkeey.git] / target / linux / generic / hack-4.9 / 661-use_fq_codel_by_default.patch
1 From 1d418f7e88035ed7a94073f6354246c66e9193e9 Mon Sep 17 00:00:00 2001
2 From: Felix Fietkau <nbd@nbd.name>
3 Date: Fri, 7 Jul 2017 17:22:58 +0200
4 Subject: fq_codel: switch default qdisc from pfifo_fast to fq_codel and remove pfifo_fast
5
6 Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 ---
8 include/net/sch_generic.h | 3 ++-
9 net/sched/Kconfig | 3 ++-
10 net/sched/sch_api.c | 2 +-
11 net/sched/sch_fq_codel.c | 3 ++-
12 net/sched/sch_generic.c | 4 ++--
13 5 files changed, 9 insertions(+), 6 deletions(-)
14
15 --- a/include/net/sch_generic.h
16 +++ b/include/net/sch_generic.h
17 @@ -339,12 +339,13 @@ extern struct Qdisc_ops noop_qdisc_ops;
18 extern struct Qdisc_ops pfifo_fast_ops;
19 extern struct Qdisc_ops mq_qdisc_ops;
20 extern struct Qdisc_ops noqueue_qdisc_ops;
21 +extern struct Qdisc_ops fq_codel_qdisc_ops;
22 extern const struct Qdisc_ops *default_qdisc_ops;
23 static inline const struct Qdisc_ops *
24 get_default_qdisc_ops(const struct net_device *dev, int ntx)
25 {
26 return ntx < dev->real_num_tx_queues ?
27 - default_qdisc_ops : &pfifo_fast_ops;
28 + default_qdisc_ops : &fq_codel_qdisc_ops;
29 }
30
31 struct Qdisc_class_common {
32 --- a/net/sched/Kconfig
33 +++ b/net/sched/Kconfig
34 @@ -3,8 +3,9 @@
35 #
36
37 menuconfig NET_SCHED
38 - bool "QoS and/or fair queueing"
39 + def_bool y
40 select NET_SCH_FIFO
41 + select NET_SCH_FQ_CODEL
42 ---help---
43 When the kernel has several packets to send out over a network
44 device, it has to decide which ones to send first, which ones to
45 --- a/net/sched/sch_api.c
46 +++ b/net/sched/sch_api.c
47 @@ -1976,7 +1976,7 @@ static int __init pktsched_init(void)
48 return err;
49 }
50
51 - register_qdisc(&pfifo_fast_ops);
52 + register_qdisc(&fq_codel_qdisc_ops);
53 register_qdisc(&pfifo_qdisc_ops);
54 register_qdisc(&bfifo_qdisc_ops);
55 register_qdisc(&pfifo_head_drop_qdisc_ops);
56 --- a/net/sched/sch_fq_codel.c
57 +++ b/net/sched/sch_fq_codel.c
58 @@ -709,7 +709,7 @@ static const struct Qdisc_class_ops fq_c
59 .walk = fq_codel_walk,
60 };
61
62 -static struct Qdisc_ops fq_codel_qdisc_ops __read_mostly = {
63 +struct Qdisc_ops fq_codel_qdisc_ops __read_mostly = {
64 .cl_ops = &fq_codel_class_ops,
65 .id = "fq_codel",
66 .priv_size = sizeof(struct fq_codel_sched_data),
67 @@ -724,6 +724,7 @@ static struct Qdisc_ops fq_codel_qdisc_o
68 .dump_stats = fq_codel_dump_stats,
69 .owner = THIS_MODULE,
70 };
71 +EXPORT_SYMBOL(fq_codel_qdisc_ops);
72
73 static int __init fq_codel_module_init(void)
74 {
75 --- a/net/sched/sch_generic.c
76 +++ b/net/sched/sch_generic.c
77 @@ -31,7 +31,7 @@
78 #include <net/dst.h>
79
80 /* Qdisc to use by default */
81 -const struct Qdisc_ops *default_qdisc_ops = &pfifo_fast_ops;
82 +const struct Qdisc_ops *default_qdisc_ops = &fq_codel_qdisc_ops;
83 EXPORT_SYMBOL(default_qdisc_ops);
84
85 /* Main transmission queue. */
86 @@ -760,7 +760,7 @@ static void attach_one_default_qdisc(str
87 void *_unused)
88 {
89 struct Qdisc *qdisc;
90 - const struct Qdisc_ops *ops = default_qdisc_ops;
91 + const struct Qdisc_ops *ops = &fq_codel_qdisc_ops;
92
93 if (dev->priv_flags & IFF_NO_QUEUE)
94 ops = &noqueue_qdisc_ops;