From: Stephen Hemminger <stephen@networkplumber.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, Stephen Hemminger <sthemmin@microsoft.com>
Subject: [PATCH net-next] net_sched: allow configuring default qdisc
Date: Sat, 8 Apr 2017 14:50:25 -0400 [thread overview]
Message-ID: <20170408185025.2104-1-sthemmin@microsoft.com> (raw)
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 analagous to how
TCP congestion control is configured.
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
net/sched/Kconfig | 31 +++++++++++++++++++++++++++++++
net/sched/sch_api.c | 7 +++++++
2 files changed, 38 insertions(+)
diff --git a/net/sched/Kconfig b/net/sched/Kconfig
index 403790cce7d2..8fb45655e59b 100644
--- a/net/sched/Kconfig
+++ b/net/sched/Kconfig
@@ -820,6 +820,37 @@ config NET_CLS_IND
classification based on the incoming device. This option is
likely to disappear in favour of the metadata ematch.
+choice
+ prompt "Default queuing discipline"
+ default DEFAULT_PFIFO
+ help
+ Select the queueing discipline that will be used by default
+ for all network devices.
+
+ config DEFAULT_FQ
+ bool "Fair Queue" if NET_SCH_FQ
+
+ config DEFAULT_FQ_CODEL
+ bool "Fair Queue Controlled Delay (FQ_CODEL)" if NET_SCH_FQ_CODEL
+
+ config DEFAULT_CODEL
+ bool "Controlled Delay (CODEL)" if NET_SCH_CODEL
+
+ config DEFAULT_SFQ
+ bool "Stochastic Fair Queue (SFQ)" if NET_SCH_SFQ
+
+ config DEFAULT_PFIFO
+ bool "Priority FIFO"
+endchoice
+
+config DEFAULT_NET_SCH
+ string
+ default "pfifo" if DEFAULT_PFIFO
+ default "fq" if DEFAULT_FQ
+ default "fq_codel" if DEFAULT_FQ_CODEL
+ default "sfq" if DEFAULT_SFQ
+ default "pfifo"
+
endif # NET_SCHED
config NET_SCH_FIFO
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index 62567bfe52c7..0d82f76f622d 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -251,6 +251,13 @@ int qdisc_set_default(const char *name)
return ops ? 0 : -ENOENT;
}
+/* 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);
+
/* 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()
--
2.11.0
next reply other threads:[~2017-04-08 18:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-08 18:50 Stephen Hemminger [this message]
2017-04-08 19:12 ` [PATCH net-next] net_sched: allow configuring default qdisc Eric Dumazet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170408185025.2104-1-sthemmin@microsoft.com \
--to=stephen@networkplumber.org \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=sthemmin@microsoft.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).