661-use_fq_codel_by_default.patch 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. From 1d418f7e88035ed7a94073f6354246c66e9193e9 Mon Sep 17 00:00:00 2001
  2. From: Felix Fietkau <[email protected]>
  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. Signed-off-by: Felix Fietkau <[email protected]>
  6. ---
  7. include/net/sch_generic.h | 3 ++-
  8. net/sched/Kconfig | 3 ++-
  9. net/sched/sch_api.c | 2 +-
  10. net/sched/sch_fq_codel.c | 3 ++-
  11. net/sched/sch_generic.c | 4 ++--
  12. 5 files changed, 9 insertions(+), 6 deletions(-)
  13. diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
  14. index e6aa0a249672..9eeb368d7eea 100644
  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. struct Qdisc_class_common {
  31. diff --git a/net/sched/Kconfig b/net/sched/Kconfig
  32. index 87956a768d1b..89c6db93cb63 100644
  33. --- a/net/sched/Kconfig
  34. +++ b/net/sched/Kconfig
  35. @@ -3,8 +3,9 @@
  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. diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
  46. index 206dc24add3a..9b5cfb6ac64b 100644
  47. --- a/net/sched/sch_api.c
  48. +++ b/net/sched/sch_api.c
  49. @@ -1976,7 +1976,7 @@ static int __init pktsched_init(void)
  50. return err;
  51. }
  52. - register_qdisc(&pfifo_fast_ops);
  53. + register_qdisc(&fq_codel_qdisc_ops);
  54. register_qdisc(&pfifo_qdisc_ops);
  55. register_qdisc(&bfifo_qdisc_ops);
  56. register_qdisc(&pfifo_head_drop_qdisc_ops);
  57. diff --git a/net/sched/sch_fq_codel.c b/net/sched/sch_fq_codel.c
  58. index 4467b95795bf..2ebbf50658e5 100644
  59. --- a/net/sched/sch_fq_codel.c
  60. +++ b/net/sched/sch_fq_codel.c
  61. @@ -705,7 +705,7 @@ static const struct Qdisc_class_ops fq_codel_class_ops = {
  62. .walk = fq_codel_walk,
  63. };
  64. -static struct Qdisc_ops fq_codel_qdisc_ops __read_mostly = {
  65. +struct Qdisc_ops fq_codel_qdisc_ops __read_mostly = {
  66. .cl_ops = &fq_codel_class_ops,
  67. .id = "fq_codel",
  68. .priv_size = sizeof(struct fq_codel_sched_data),
  69. @@ -720,6 +720,7 @@ static struct Qdisc_ops fq_codel_qdisc_ops __read_mostly = {
  70. .dump_stats = fq_codel_dump_stats,
  71. .owner = THIS_MODULE,
  72. };
  73. +EXPORT_SYMBOL(fq_codel_qdisc_ops);
  74. static int __init fq_codel_module_init(void)
  75. {
  76. diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
  77. index 6cfb6e9038c2..97de97e3c5e2 100644
  78. --- a/net/sched/sch_generic.c
  79. +++ b/net/sched/sch_generic.c
  80. @@ -31,7 +31,7 @@
  81. #include <net/dst.h>
  82. /* Qdisc to use by default */
  83. -const struct Qdisc_ops *default_qdisc_ops = &pfifo_fast_ops;
  84. +const struct Qdisc_ops *default_qdisc_ops = &fq_codel_qdisc_ops;
  85. EXPORT_SYMBOL(default_qdisc_ops);
  86. /* Main transmission queue. */
  87. @@ -759,7 +759,7 @@ static void attach_one_default_qdisc(struct net_device *dev,
  88. void *_unused)
  89. {
  90. struct Qdisc *qdisc;
  91. - const struct Qdisc_ops *ops = default_qdisc_ops;
  92. + const struct Qdisc_ops *ops = &fq_codel_qdisc_ops;
  93. if (dev->priv_flags & IFF_NO_QUEUE)
  94. ops = &noqueue_qdisc_ops;
  95. --
  96. 2.11.0