Cake - FQ_codel the next generation
 help / color / mirror / Atom feed
From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	 Jamal Hadi Salim <jhs@mojatatu.com>,
	Cong Wang <xiyou.wangcong@gmail.com>,
	Jiri Pirko <jiri@resnulli.us>, Paolo Abeni <pabeni@redhat.com>,
	"Toke Hoiland-Jorgensen" <toke@toke.dk>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	cake@lists.bufferbloat.net
Subject: [Cake] [PATCH net-next] sch_cake: Take into account guideline DEF/DGSIC/36 from French Administration
Date: Mon, 28 Mar 2022 14:03:24 +0200	[thread overview]
Message-ID: <356a242a964fabbdf876a18c7640eb6ead6d0e6b.1648468695.git.christophe.leroy@csgroup.eu> (raw)

French Administration has written a guideline that defines additional
DSCP values for use in its networks.

Add new CAKE diffserv tables to take those new values into account
and add CONFIG_NET_SCH_CAKE_DGSIC to select those tables instead of
the default ones.

The document is available at
https://www.bo.sga.defense.gouv.fr/texte/signe/264219/N%C2%B0%2036/DEF/DGSIC.pdf
or https://www.bo.sga.defense.gouv.fr/texte/264219/N%C2%B0%2036/DEF/DGSIC.html

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
 net/sched/Kconfig    | 11 +++++++++++
 net/sched/sch_cake.c | 42 +++++++++++++++++++++++++++++++++++++++---
 2 files changed, 50 insertions(+), 3 deletions(-)

diff --git a/net/sched/Kconfig b/net/sched/Kconfig
index 1e8ab4749c6c..b99f247404e0 100644
--- a/net/sched/Kconfig
+++ b/net/sched/Kconfig
@@ -331,6 +331,17 @@ config NET_SCH_CAKE
 
 	  If unsure, say N.
 
+config NET_SCH_CAKE_DGSIC
+	bool "CAKE: Follow French Administration's guideline DEF/DGSIC/36"
+	depends on NET_SCH_CAKE
+	help
+	  Say Y here if you want to use the Common Applications Kept Enhanced
+	  (CAKE) queue management algorithm in an environment that requires to
+	  take into account additional DSCP values defined by the French
+	  Administration in the guideline document identified DEF/DGSIC/36,
+	  available at
+	  https://www.bo.sga.defense.gouv.fr/texte/signe/264219/N%C2%B0%2036/DEF/DGSIC.pdf
+
 config NET_SCH_FQ
 	tristate "Fair Queue"
 	help
diff --git a/net/sched/sch_cake.c b/net/sched/sch_cake.c
index a43a58a73d09..3d9af3a68c05 100644
--- a/net/sched/sch_cake.c
+++ b/net/sched/sch_cake.c
@@ -322,6 +322,17 @@ static const u8 diffserv8[] = {
 	7, 2, 2, 2, 2, 2, 2, 2,
 };
 
+static const u8 diffserv8_dgsic[] = {
+	2, 0, 1, 2, 4, 2, 2, 2,
+	1, 1, 1, 2, 1, 1, 1, 2,
+	5, 4, 4, 2, 4, 4, 4, 2,
+	3, 3, 3, 2, 3, 3, 3, 2,
+	6, 3, 3, 2, 3, 3, 3, 2,
+	6, 6, 6, 2, 6, 6, 6, 2,
+	7, 2, 2, 2, 2, 2, 2, 2,
+	7, 2, 2, 2, 2, 2, 2, 2,
+};
+
 static const u8 diffserv4[] = {
 	0, 1, 0, 0, 2, 0, 0, 0,
 	1, 0, 0, 0, 0, 0, 0, 0,
@@ -333,6 +344,17 @@ static const u8 diffserv4[] = {
 	3, 0, 0, 0, 0, 0, 0, 0,
 };
 
+static const u8 diffserv4_dgsic[] = {
+	0, 1, 0, 0, 2, 0, 0, 0,
+	1, 0, 0, 0, 0, 0, 0, 0,
+	2, 2, 2, 0, 2, 2, 2, 0,
+	2, 2, 2, 0, 2, 2, 2, 0,
+	3, 2, 2, 0, 2, 2, 2, 0,
+	3, 3, 3, 0, 3, 3, 3, 0,
+	3, 0, 0, 0, 0, 0, 0, 0,
+	3, 0, 0, 0, 0, 0, 0, 0,
+};
+
 static const u8 diffserv3[] = {
 	0, 1, 0, 0, 2, 0, 0, 0,
 	1, 0, 0, 0, 0, 0, 0, 0,
@@ -344,6 +366,17 @@ static const u8 diffserv3[] = {
 	2, 0, 0, 0, 0, 0, 0, 0,
 };
 
+static const u8 diffserv3_dgsic[] = {
+	0, 1, 0, 0, 2, 0, 0, 0,
+	1, 0, 0, 0, 0, 0, 0, 0,
+	0, 0, 0, 0, 0, 0, 0, 0,
+	0, 0, 0, 0, 0, 0, 0, 0,
+	0, 0, 0, 0, 0, 0, 0, 0,
+	0, 2, 2, 0, 2, 2, 2, 0,
+	2, 0, 0, 0, 0, 0, 0, 0,
+	2, 0, 0, 0, 0, 0, 0, 0,
+};
+
 static const u8 besteffort[] = {
 	0, 0, 0, 0, 0, 0, 0, 0,
 	0, 0, 0, 0, 0, 0, 0, 0,
@@ -2409,7 +2442,8 @@ static int cake_config_diffserv8(struct Qdisc *sch)
 	q->tin_cnt = 8;
 
 	/* codepoint to class mapping */
-	q->tin_index = diffserv8;
+	q->tin_index = IS_ENABLED(CONFIG_NET_SCH_CAKE_DGSIC) ? diffserv8_dgsic :
+							       diffserv8;
 	q->tin_order = normal_order;
 
 	/* class characteristics */
@@ -2452,7 +2486,8 @@ static int cake_config_diffserv4(struct Qdisc *sch)
 	q->tin_cnt = 4;
 
 	/* codepoint to class mapping */
-	q->tin_index = diffserv4;
+	q->tin_index = IS_ENABLED(CONFIG_NET_SCH_CAKE_DGSIC) ? diffserv4_dgsic :
+							       diffserv4;
 	q->tin_order = bulk_order;
 
 	/* class characteristics */
@@ -2489,7 +2524,8 @@ static int cake_config_diffserv3(struct Qdisc *sch)
 	q->tin_cnt = 3;
 
 	/* codepoint to class mapping */
-	q->tin_index = diffserv3;
+	q->tin_index = IS_ENABLED(CONFIG_NET_SCH_CAKE_DGSIC) ? diffserv3_dgsic :
+							       diffserv3;
 	q->tin_order = bulk_order;
 
 	/* class characteristics */
-- 
2.35.1


             reply	other threads:[~2022-03-28 12:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-28 12:03 Christophe Leroy [this message]
2022-03-28 15:43 ` Toke Høiland-Jørgensen
2022-03-28 16:19   ` Christophe Leroy
2022-03-28 16:42     ` Toke Høiland-Jørgensen

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

  List information: https://lists.bufferbloat.net/postorius/lists/cake.lists.bufferbloat.net/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=356a242a964fabbdf876a18c7640eb6ead6d0e6b.1648468695.git.christophe.leroy@csgroup.eu \
    --to=christophe.leroy@csgroup.eu \
    --cc=cake@lists.bufferbloat.net \
    --cc=davem@davemloft.net \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=toke@toke.dk \
    --cc=xiyou.wangcong@gmail.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