summaryrefslogtreecommitdiffstats
path: root/net/sched/sch_api.c
diff options
context:
space:
mode:
authorstephen hemminger <stephen@networkplumber.org>2017-04-13 08:40:53 -0700
committerDavid S. Miller <davem@davemloft.net>2017-04-17 13:23:06 -0400
commit8ea3e439115a50b1927a4d035b2f84c46fc61c42 (patch)
tree8625511224c100bdd07016eea85d0bad0027d235 /net/sched/sch_api.c
parent7ca9511813c991f44b9e1b94aeeee488df401580 (diff)
downloadlinux-8ea3e439115a50b1927a4d035b2f84c46fc61c42.tar.bz2
Subject: net: allow configuring default qdisc
Since 3.12 it has been possible to configure the default queuing discipline via sysctl. This patch adds ability to configure the default queue discipline in kernel configuration. This is useful for environments where configuring the value from userspace is difficult to manage. The default is still the same as before (pfifo_fast) and it is possible to change after kernel init with sysctl. This is similar to how TCP congestion control works. Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_api.c')
-rw-r--r--net/sched/sch_api.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index fcb5ae581c04..9b09ef9f944d 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -251,6 +251,15 @@ int qdisc_set_default(const char *name)
return ops ? 0 : -ENOENT;
}
+#ifdef CONFIG_NET_SCH_DEFAULT
+/* Set default value from kernel config */
+static int __init sch_default_qdisc(void)
+{
+ return qdisc_set_default(CONFIG_DEFAULT_NET_SCH);
+}
+late_initcall(sch_default_qdisc);
+#endif
+
/* We know handle. Find qdisc among all qdisc's attached to device
* (root qdisc, all its children, children of children etc.)
* Note: caller either uses rtnl or rcu_read_lock()