661-use_fq_codel_by_default.patch 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. Signed-off-by: Felix Fietkau <nbd@nbd.name>
  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. --- a/include/net/sch_generic.h
  14. +++ b/include/net/sch_generic.h
  15. @@ -373,12 +373,13 @@ extern struct Qdisc_ops noop_qdisc_ops;
  16. extern struct Qdisc_ops pfifo_fast_ops;
  17. extern struct Qdisc_ops mq_qdisc_ops;
  18. extern struct Qdisc_ops noqueue_qdisc_ops;
  19. +extern struct Qdisc_ops fq_codel_qdisc_ops;
  20. extern const struct Qdisc_ops *default_qdisc_ops;
  21. static inline const struct Qdisc_ops *
  22. get_default_qdisc_ops(const struct net_device *dev, int ntx)
  23. {
  24. return ntx < dev->real_num_tx_queues ?
  25. - default_qdisc_ops : &pfifo_fast_ops;
  26. + default_qdisc_ops : &fq_codel_qdisc_ops;
  27. }
  28. struct Qdisc_class_common {
  29. --- a/net/sched/Kconfig
  30. +++ b/net/sched/Kconfig
  31. @@ -3,8 +3,9 @@
  32. #
  33. menuconfig NET_SCHED
  34. - bool "QoS and/or fair queueing"
  35. + def_bool y
  36. select NET_SCH_FIFO
  37. + select NET_SCH_FQ_CODEL
  38. ---help---
  39. When the kernel has several packets to send out over a network
  40. device, it has to decide which ones to send first, which ones to
  41. --- a/net/sched/sch_api.c
  42. +++ b/net/sched/sch_api.c
  43. @@ -2037,7 +2037,7 @@ static int __init pktsched_init(void)
  44. return err;
  45. }
  46. - register_qdisc(&pfifo_fast_ops);
  47. + register_qdisc(&fq_codel_qdisc_ops);
  48. register_qdisc(&pfifo_qdisc_ops);
  49. register_qdisc(&bfifo_qdisc_ops);
  50. register_qdisc(&pfifo_head_drop_qdisc_ops);
  51. --- a/net/sched/sch_fq_codel.c
  52. +++ b/net/sched/sch_fq_codel.c
  53. @@ -700,7 +700,7 @@ static const struct Qdisc_class_ops fq_c
  54. .walk = fq_codel_walk,
  55. };
  56. -static struct Qdisc_ops fq_codel_qdisc_ops __read_mostly = {
  57. +struct Qdisc_ops fq_codel_qdisc_ops __read_mostly = {
  58. .cl_ops = &fq_codel_class_ops,
  59. .id = "fq_codel",
  60. .priv_size = sizeof(struct fq_codel_sched_data),
  61. @@ -715,6 +715,7 @@ static struct Qdisc_ops fq_codel_qdisc_o
  62. .dump_stats = fq_codel_dump_stats,
  63. .owner = THIS_MODULE,
  64. };
  65. +EXPORT_SYMBOL(fq_codel_qdisc_ops);
  66. static int __init fq_codel_module_init(void)
  67. {
  68. --- a/net/sched/sch_generic.c
  69. +++ b/net/sched/sch_generic.c
  70. @@ -32,7 +32,7 @@
  71. #include <trace/events/qdisc.h>
  72. /* Qdisc to use by default */
  73. -const struct Qdisc_ops *default_qdisc_ops = &pfifo_fast_ops;
  74. +const struct Qdisc_ops *default_qdisc_ops = &fq_codel_qdisc_ops;
  75. EXPORT_SYMBOL(default_qdisc_ops);
  76. /* Main transmission queue. */
  77. @@ -765,7 +765,7 @@ static void attach_one_default_qdisc(str
  78. void *_unused)
  79. {
  80. struct Qdisc *qdisc;
  81. - const struct Qdisc_ops *ops = default_qdisc_ops;
  82. + const struct Qdisc_ops *ops = &fq_codel_qdisc_ops;
  83. if (dev->priv_flags & IFF_NO_QUEUE)
  84. ops = &noqueue_qdisc_ops;