Cake - FQ_codel the next generation
 help / color / mirror / Atom feed
* [Cake] [PATCH net-next] sch_cake: Take into account guideline DEF/DGSIC/36 from French Administration
@ 2022-03-28 12:03 Christophe Leroy
  2022-03-28 15:43 ` Toke Høiland-Jørgensen
  0 siblings, 1 reply; 4+ messages in thread
From: Christophe Leroy @ 2022-03-28 12:03 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski, Jamal Hadi Salim, Cong Wang,
	Jiri Pirko, Paolo Abeni, Toke Hoiland-Jorgensen
  Cc: Christophe Leroy, linux-kernel, netdev, cake

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Cake] [PATCH net-next] sch_cake: Take into account guideline DEF/DGSIC/36 from French Administration
  2022-03-28 12:03 [Cake] [PATCH net-next] sch_cake: Take into account guideline DEF/DGSIC/36 from French Administration Christophe Leroy
@ 2022-03-28 15:43 ` Toke Høiland-Jørgensen
  2022-03-28 16:19   ` Christophe Leroy
  0 siblings, 1 reply; 4+ messages in thread
From: Toke Høiland-Jørgensen @ 2022-03-28 15:43 UTC (permalink / raw)
  To: Christophe Leroy, David S. Miller, Jakub Kicinski,
	Jamal Hadi Salim, Cong Wang, Jiri Pirko, Paolo Abeni
  Cc: Christophe Leroy, linux-kernel, netdev, cake

Christophe Leroy <christophe.leroy@csgroup.eu> writes:

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

Huh, that's interesting!

> 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.

...however I don't think we should be including something this
special-purpose into the qdisc kernel code, and certainly we shouldn't
have a config option that changes the meaning of the existing diffserv
keywords!

Rather, this is something that is best specified from userspace; and in
fact Cake already has no less than two different ways to do this: the
'fwmark' option, and setting the skb->priority field. Have you tried
using those?

-Toke

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Cake] [PATCH net-next] sch_cake: Take into account guideline DEF/DGSIC/36 from French Administration
  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
  0 siblings, 1 reply; 4+ messages in thread
From: Christophe Leroy @ 2022-03-28 16:19 UTC (permalink / raw)
  To: Toke Høiland-Jørgensen, David S. Miller,
	Jakub Kicinski, Jamal Hadi Salim, Cong Wang, Jiri Pirko,
	Paolo Abeni
  Cc: linux-kernel, netdev, cake



Le 28/03/2022 à 17:43, Toke Høiland-Jørgensen a écrit :
> Christophe Leroy <christophe.leroy@csgroup.eu> writes:
> 
>> French Administration has written a guideline that defines additional
>> DSCP values for use in its networks.
> 
> Huh, that's interesting!
> 
>> 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.
> 
> ...however I don't think we should be including something this
> special-purpose into the qdisc kernel code, and certainly we shouldn't
> have a config option that changes the meaning of the existing diffserv
> keywords!

By the way it doesn't really change meaning. Just enhances it indeed. 
Because they are not changing the meaning of existing DSCP codes, just 
adding new ones.

> 
> Rather, this is something that is best specified from userspace; and in
> fact Cake already has no less than two different ways to do this: the
> 'fwmark' option, and setting the skb->priority field. Have you tried
> using those?

No I have not. In fact I'm just discovering the subject after some 
people told me "we are contractually required to apply this guideline, 
please make sure Linux kernel supports it".

I'll give 'fwmark' and/or skb->priority a try. Is there any 
Documentation on that somewhere ?

Thanks
Christophe

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Cake] [PATCH net-next] sch_cake: Take into account guideline DEF/DGSIC/36 from French Administration
  2022-03-28 16:19   ` Christophe Leroy
@ 2022-03-28 16:42     ` Toke Høiland-Jørgensen
  0 siblings, 0 replies; 4+ messages in thread
From: Toke Høiland-Jørgensen @ 2022-03-28 16:42 UTC (permalink / raw)
  To: Christophe Leroy, David S. Miller, Jakub Kicinski,
	Jamal Hadi Salim, Cong Wang, Jiri Pirko, Paolo Abeni
  Cc: linux-kernel, netdev, cake

Christophe Leroy <christophe.leroy@csgroup.eu> writes:

> Le 28/03/2022 à 17:43, Toke Høiland-Jørgensen a écrit :
>> Christophe Leroy <christophe.leroy@csgroup.eu> writes:
>> 
>>> French Administration has written a guideline that defines additional
>>> DSCP values for use in its networks.
>> 
>> Huh, that's interesting!
>> 
>>> 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.
>> 
>> ...however I don't think we should be including something this
>> special-purpose into the qdisc kernel code, and certainly we shouldn't
>> have a config option that changes the meaning of the existing diffserv
>> keywords!
>
> By the way it doesn't really change meaning. Just enhances it indeed. 
> Because they are not changing the meaning of existing DSCP codes, just 
> adding new ones.

Ah, OK, but then it's even easier, you can just add rules for the new
values using the userspace options and let cake select the rest using
the existing code.

>> Rather, this is something that is best specified from userspace; and in
>> fact Cake already has no less than two different ways to do this: the
>> 'fwmark' option, and setting the skb->priority field. Have you tried
>> using those?
>
> No I have not. In fact I'm just discovering the subject after some 
> people told me "we are contractually required to apply this guideline, 
> please make sure Linux kernel supports it".
>
> I'll give 'fwmark' and/or skb->priority a try. Is there any 
> Documentation on that somewhere ?

Both are documented in the tc-cake man page.

-Toke


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-03-28 16:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-28 12:03 [Cake] [PATCH net-next] sch_cake: Take into account guideline DEF/DGSIC/36 from French Administration Christophe Leroy
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox