kernel: split patches folder up into backport, pending and hack folders
[oweals/openwrt.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 diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
16 index e6aa0a249672..9eeb368d7eea 100644
17 --- a/include/net/sch_generic.h
18 +++ b/include/net/sch_generic.h
19 @@ -339,12 +339,13 @@ extern struct Qdisc_ops noop_qdisc_ops;
20  extern struct Qdisc_ops pfifo_fast_ops;
21  extern struct Qdisc_ops mq_qdisc_ops;
22  extern struct Qdisc_ops noqueue_qdisc_ops;
23 +extern struct Qdisc_ops fq_codel_qdisc_ops;
24  extern const struct Qdisc_ops *default_qdisc_ops;
25  static inline const struct Qdisc_ops *
26  get_default_qdisc_ops(const struct net_device *dev, int ntx)
27  {
28         return ntx < dev->real_num_tx_queues ?
29 -                       default_qdisc_ops : &pfifo_fast_ops;
30 +                       default_qdisc_ops : &fq_codel_qdisc_ops;
31  }
32  
33  struct Qdisc_class_common {
34 diff --git a/net/sched/Kconfig b/net/sched/Kconfig
35 index 87956a768d1b..89c6db93cb63 100644
36 --- a/net/sched/Kconfig
37 +++ b/net/sched/Kconfig
38 @@ -3,8 +3,9 @@
39  # 
40  
41  menuconfig NET_SCHED
42 -       bool "QoS and/or fair queueing"
43 +       def_bool y
44         select NET_SCH_FIFO
45 +       select NET_SCH_FQ_CODEL
46         ---help---
47           When the kernel has several packets to send out over a network
48           device, it has to decide which ones to send first, which ones to
49 diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
50 index 206dc24add3a..9b5cfb6ac64b 100644
51 --- a/net/sched/sch_api.c
52 +++ b/net/sched/sch_api.c
53 @@ -1976,7 +1976,7 @@ static int __init pktsched_init(void)
54                 return err;
55         }
56  
57 -       register_qdisc(&pfifo_fast_ops);
58 +       register_qdisc(&fq_codel_qdisc_ops);
59         register_qdisc(&pfifo_qdisc_ops);
60         register_qdisc(&bfifo_qdisc_ops);
61         register_qdisc(&pfifo_head_drop_qdisc_ops);
62 diff --git a/net/sched/sch_fq_codel.c b/net/sched/sch_fq_codel.c
63 index 4467b95795bf..2ebbf50658e5 100644
64 --- a/net/sched/sch_fq_codel.c
65 +++ b/net/sched/sch_fq_codel.c
66 @@ -705,7 +705,7 @@ static const struct Qdisc_class_ops fq_codel_class_ops = {
67         .walk           =       fq_codel_walk,
68  };
69  
70 -static struct Qdisc_ops fq_codel_qdisc_ops __read_mostly = {
71 +struct Qdisc_ops fq_codel_qdisc_ops __read_mostly = {
72         .cl_ops         =       &fq_codel_class_ops,
73         .id             =       "fq_codel",
74         .priv_size      =       sizeof(struct fq_codel_sched_data),
75 @@ -720,6 +720,7 @@ static struct Qdisc_ops fq_codel_qdisc_ops __read_mostly = {
76         .dump_stats =   fq_codel_dump_stats,
77         .owner          =       THIS_MODULE,
78  };
79 +EXPORT_SYMBOL(fq_codel_qdisc_ops);
80  
81  static int __init fq_codel_module_init(void)
82  {
83 diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
84 index 6cfb6e9038c2..97de97e3c5e2 100644
85 --- a/net/sched/sch_generic.c
86 +++ b/net/sched/sch_generic.c
87 @@ -31,7 +31,7 @@
88  #include <net/dst.h>
89  
90  /* Qdisc to use by default */
91 -const struct Qdisc_ops *default_qdisc_ops = &pfifo_fast_ops;
92 +const struct Qdisc_ops *default_qdisc_ops = &fq_codel_qdisc_ops;
93  EXPORT_SYMBOL(default_qdisc_ops);
94  
95  /* Main transmission queue. */
96 @@ -759,7 +759,7 @@ static void attach_one_default_qdisc(struct net_device *dev,
97                                      void *_unused)
98  {
99         struct Qdisc *qdisc;
100 -       const struct Qdisc_ops *ops = default_qdisc_ops;
101 +       const struct Qdisc_ops *ops = &fq_codel_qdisc_ops;
102  
103         if (dev->priv_flags & IFF_NO_QUEUE)
104                 ops = &noqueue_qdisc_ops;
105 -- 
106 2.11.0
107