Bug#972784: Malformated JSON on tc qdisc

2020-11-28 Thread romeo.ginon
2","root":true,"options":{}},{"kind":"pfifo_fast","handle":"0:","dev":"enp1s0f2","parent":":10","options":{"bands":3,"priomap
 
":[1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1],"multiqueue":false}},{"kind":"pfifo_fast","handle":"0:","dev":"enp1s0f2","parent":":f","options":{"bands":3,"priomap
 
":[1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1],"multiqueue":false}},{"kind":"pfifo_fast","handle":"0:","dev":"enp1s0f2","parent":":e","options":{"bands":3,"priomap
 
":[1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1],"multiqueue":false}},{"kind":"pfifo_fast","handle":"0:","dev":"enp1s0f2","parent":":d","options":{"bands":3,"priomap
 
":[1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1],"multiqueue":false}},{"kind":"pfifo_fast","handle":"0:","dev":"enp1s0f2","parent":":c","options":{"bands":3,"priomap
 
":[1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1],"multiqueue":false}},{"kind":"pfifo_fast","handle":"0:","dev":"enp1s0f2","parent":":b","options":{"bands":3,"priomap
 
":[1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1],"multiqueue":false}},{"kind":"pfifo_fast","handle":"0:","dev":"enp1s0f2","parent":":a","options":{"bands":3,"priomap
 
":[1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1],"multiqueue":false}},{"kind":"pfifo_fast","handle":"0:","dev":"enp1s0f2","parent":":9","options":{"bands":3,"priomap
 
":[1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1],"multiqueue":false}},{"kind":"pfifo_fast","handle":"0:","dev":"enp1s0f2","parent":":8","options":{"bands":3,"priomap
 
":[1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1],"multiqueue":false}},{"kind":"pfifo_fast","handle":"0:","dev":"enp1s0f2","parent":":7","options":{"bands":3,"priomap
 
":[1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1],"multiqueue":false}},{"kind":"pfifo_fast","handle":"0:","dev":"enp1s0f2","parent":":6","options":{"bands":3,"priomap
 
":[1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1],"multiqueue":false}},{"kind":"pfifo_fast","handle":"0:","dev":"enp1s0f2","parent":":5","options":{"bands":3,"priomap
 
":[1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1],"multiqueue":false}},{"kind":"pfifo_fast","handle":"0:","dev":"enp1s0f2","parent":":4","options":{"bands":3,"priomap
 
":[1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1],"multiqueue":false}},{"kind":"pfifo_fast","handle":"0:","dev":"enp1s0f2","parent":":3","options":{"bands":3,"priomap
 
":[1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1],"multiqueue":false}},{"kind":"pfifo_fast","handle":"0:","dev":"enp1s0f2","parent":":2","options":{"bands":3,"priomap
 
":[1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1],"multiqueue":false}},{"kind":"pfifo_fast","handle":"0:","dev":"enp1s0f2","parent":":1","options":{"bands":3,"priomap
 
":[1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1],"multiqueue":false}},{"kind":"mq","handle":"0:","dev":"enp1s0f3","root":true,"options":{}},{"kind":"pfifo_fast","handle":"0:","dev":"enp1s0f3","parent":":10","options":{"bands":3,"priomap
 
":[1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1],"multiqueue":false}},{"kind":"pfifo_fast","handle":"0:","dev":"enp1s0f3","parent":":f","options":{"bands":3,"priomap
 
":[1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1],"multiqueue":false}},{"kind":"pfifo_fast","handle":"0:","dev":"enp1s0f3","parent":":e","options":{"bands":3,"priomap
 
":[1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1],"multiqueue":false}},{"kind":"pfifo_fast","handle":"0:","dev":"enp1s0f3","parent":":d","options":{"bands":3,"priomap
 
":[1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1],"multiqueue":false}},{"kind":"pfifo_fast","handle":"0:","dev":"enp1s0f3","parent":":c","options":{"bands":3,"priomap
 
":[1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1],"multiqueue":false}},{"kind":"pfifo_fast","handle":"0:","dev":"enp1s0f3","parent":":b","options":{"bands":3,"priomap
 
":[1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1],"multiqueue":false}},{"kind":"pfifo_fast","handle":"0:","dev":"enp1s0f3","parent":":a","options":{"bands":3,"priomap
 
":[1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1],"multiqueue":false}},{"kind":"pfifo_fast","handle":"0:","dev":"enp1s0f3","parent":":9","options":{"bands":3,"priomap
 
":[1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1],"multiqueue":false}},{"kind":"pfifo_fast","handle":"0:","dev":"enp1s0f3","parent":":8","options":{"bands":3,"priomap
 
":[1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1],"multiqueue":false}},{"kind":"pfifo_fast","handle":"0:","dev":"enp1s0f3","parent":":7","options":{"bands":3,"priomap
 
":[1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1],"multiqueue":false}},{"kind":"pfifo_fast","handle":"0:","dev":"enp1s0f3","parent":":6","options":{"bands":3,"priomap
 
":[1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1],"multiqueue":false}},{"kind":"pfifo_fast","handle":"0:","dev":"enp1s0f3","parent":":5","options":{"bands":3,"priomap
 
":[1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1],"multiqueue":false}},{"kind":"pfifo_fast","handle":"0:","dev":"enp1s0f3","parent":":4","options":{"bands":3,"priomap
 
":[1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1],"multiqueue":false}},{"kind":"pfifo_fast","handle":"0:","dev":"enp1s0f3","parent":":3","options":{"bands":3,"priomap
 
":[1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1],"multiqueue":false}},{"kind":"pfifo_fast","handle":"0:","dev":"enp1s0f3","parent":":2","options":{"bands":3,"priomap
 
":[1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1],"multiqueue":false}},{"kind":"pfifo_fast","handle":"0:","dev":"enp1s0f3","parent":":1","options":{"bands":3,"priomap
 
":[1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1],"multiqueue":false}},{"kind":"noqueue","handle":"0:","dev":"enp1s0f3.1900","root":true,"refcnt":2,"options":{}},{"kind":"noqueue","handle":"0:","dev":"enp1s0f2.10","root":true,"refcnt":2,"options":{}}]

 

Thank you. Let me know if you still need more tests.

 

Have a good weekend.

 

Regards,

 

Roméo GINON

 

-Message d'origine-
De : Luca Boccassi  
Envoyé : 27 novembre 2020 18:47
À : romeo.gi...@ilexia.com; 972...@bugs.debian.org
Objet : Re: Bug#972784: Malformated JSON on tc qdisc

 

On Fri, 2020-11-27 at 18:06 +0100,  <mailto:romeo.gi...@ilexia.com> 
romeo.gi...@ilexia.com wrote:

> Hello,

> 

>  

> 

> It's better but still malformated (ip utility, iproute2-ss190107 + 

> patch 1407305 ).

> 

>  

> 

> Please find below output result. Thank you for your consideration, let 

> me know if you need more tests.

> 

>  

> 

> 

> tc -j  -p qdisc show dev enp1s0f0

> 

> 

> [ {

> 

> "kind": "mqprio",

> 

> "handle": "8001:",

> 

> "root": true,

> 

> "options": {

> 

> "tc": 2,

> 

> "map": [ 0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0 ],

> 

> "queues": [

> 

> "": [ 0,3 ],

> 

> "": [ 4,7 ] ],

> 

> "mode": "channel",

> 

> "shaper": "dcb"

> 

> }

 

Thanks for checking, could you please try again with the attached new version 
of the patch?

 

 

 

--

Kind regards,

Luca Boccassi



Bug#972784: Malformated JSON on tc qdisc

2020-11-27 Thread romeo.ginon
Hello,

 

It's better but still malformated (ip utility, iproute2-ss190107 + patch 
1407305 ).

 

Please find below output result. Thank you for your consideration, let me know 
if you need more tests.

 


tc -j  -p qdisc show dev enp1s0f0


[ {

"kind": "mqprio",

"handle": "8001:",

"root": true,

"options": {

"tc": 2,

"map": [ 0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0 ],

"queues": [

"": [ 0,3 ],

"": [ 4,7 ] ],

"mode": "channel",

"shaper": "dcb"

}

},{

"kind": "pfifo_fast",

"handle": "0:",

"parent": "8001:8",

"options": {

"bands": 3,

"priomap ": [ 1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1 ],

"multiqueue": false

}

},{

"kind": "pfifo_fast",

"handle": "0:",

"parent": "8001:7",

"options": {

"bands": 3,

"priomap ": [ 1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1 ],

"multiqueue": false

}

},{

"kind": "pfifo_fast",

"handle": "0:",

"parent": "8001:6",

"options": {

"bands": 3,

"priomap ": [ 1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1 ],

"multiqueue": false

}

},{

"kind": "pfifo_fast",

"handle": "0:",

"parent": "8001:5",

"options": {

"bands": 3,

"priomap ": [ 1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1 ],

"multiqueue": false

}

},{

"kind": "pfifo_fast",

"handle": "0:",

"parent": "8001:4",

"options": {

"bands": 3,

"priomap ": [ 1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1 ],

"multiqueue": false

}

},{

"kind": "pfifo_fast",

"handle": "0:",

"parent": "8001:3",

"options": {

"bands": 3,

"priomap ": [ 1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1 ],

"multiqueue": false

}

},{

"kind": "pfifo_fast",

"handle": "0:",

"parent": "8001:2",

"options": {

"bands": 3,

"priomap ": [ 1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1 ],

"multiqueue": false

}

},{

"kind": "pfifo_fast",

"handle": "0:",

"parent": "8001:1",

"options": {

"bands": 3,

"priomap ": [ 1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1 ],

"multiqueue": false

}

} ]


tc qdisc show dev enp1s0f0


qdisc mqprio 8001: root tc 2 map 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0

 queues:(0:3) (4:7)

 mode:channel

 shaper:dcb

qdisc pfifo_fast 0: parent 8001:8 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 
1 1

qdisc pfifo_fast 0: parent 8001:7 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 
1 1

qdisc pfifo_fast 0: parent 8001:6 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 
1 1

qdisc pfifo_fast 0: parent 8001:5 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 
1 1

qdisc pfifo_fast 0: parent 8001:4 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 
1 1

qdisc pfifo_fast 0: parent 8001:3 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 
1 1

qdisc pfifo_fast 0: parent 8001:2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 
1 1

qdisc pfifo_fast 0: parent 8001:1 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 
1 1

 

Regards,

Romeo GINON

 

-Message d'origine-
De : Luca Boccassi  
Envoyé : 27 novembre 2020 16:31
À : 972...@bugs.debian.org
Cc : romeo.gi...@ilexia.com
Objet : Re: Malformated JSON on tc qdisc

 

Control: tags -1 forwarded patch

 

On Fri, 23 Oct 2020 16:08:31 +0200 =?iso-8859-1?Q?ILEXIA_-_Rom=E9o_GINON?= < 
 romeo.gi...@ilexia.com> wrote:

> Package: iproute2

> 

> Version: 4.20.0-2

> 

> Severity : important

> 

>  

> 

> I have some issues with JSON output on tc qdisc.

> 

>  

> 

> Impact : tc command return malformated json when using mqprio with 

> priomap or dsmark.

> 

> On both test case ("kind": "dsmark" or "kind": "mqprio" with "root": 

> true) associated "options" are not in a valid json format.

> 

>  

> 

>  

> 

> Test Case : 

> 

> 1: /usr/sbin/tc qdisc add dev $IFACE root mqprio num_tc 2 queues 4@0 

> 4@4 hw

> 1 mode channel map 0 0 0 1 0 1 0 0'

> 

> 2: /usr/sbin/tc qdisc add dev $IFACE  handle 1:0 root dsmark indices 

> 64 set_tc_index

> 

>  

> 

> Command : tc -j -p qdisc show

> 

>  

> 

>  

> 

> 

> Malformated

> 

> 

> {

> 

>  "kind": "mqprio",

> 

>  "handle": "8021:",

> 

>  "dev": "enp1s0f0",

> 

>  "root": true,

> 

>  "options": { tc 2 map 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0

> 

>   queues:(0:3) (4:7)

> 

>   mode:channel

> 

>   shaper:dcb}

> 

 

I sent a patch upstream to json-ify the output, but I do not have hardware 
capable of configuring mqprio.

 

If 

Bug#972784: Malformated JSON on tc qdisc

2020-11-27 Thread Luca Boccassi
On Fri, 2020-11-27 at 18:06 +0100, romeo.gi...@ilexia.com wrote:
> Hello,
> 
>  
> 
> It's better but still malformated (ip utility, iproute2-ss190107 +
> patch 1407305 ).
> 
>  
> 
> Please find below output result. Thank you for your consideration,
> let me know if you need more tests.
> 
>  
> 
> 
> tc -j  -p qdisc show dev enp1s0f0
> 
> 
> [ {
> 
>     "kind": "mqprio",
> 
>     "handle": "8001:",
> 
>     "root": true,
> 
>     "options": {
> 
>     "tc": 2,
> 
>     "map": [ 0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0 ],
> 
>     "queues": [
> 
>     "": [ 0,3 ],
> 
>     "": [ 4,7 ] ],
> 
>     "mode": "channel",
> 
>     "shaper": "dcb"
> 
>     }

Thanks for checking, could you please try again with the attached new
version of the patch?



-- 
Kind regards,
Luca Boccassi
From 22965bd694435f67151e54c7ee0b966fcee2333e Mon Sep 17 00:00:00 2001
From: Luca Boccassi 
Date: Fri, 27 Nov 2020 15:09:44 +
Subject: [PATCH] tc/mqprio: json-ify output

As reported by a Debian user, mqprio output in json mode is
invalid:

{
 "kind": "mqprio",
 "handle": "8021:",
 "dev": "enp1s0f0",
 "root": true,
 "options": { tc 2 map 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0
  queues:(0:3) (4:7)
  mode:channel
  shaper:dcb}
}

json-ify it, while trying to maintain the same formatting
for standard output.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=972784

Signed-off-by: Luca Boccassi 
---
 tc/q_mqprio.c | 34 --
 1 file changed, 20 insertions(+), 14 deletions(-)

diff --git a/tc/q_mqprio.c b/tc/q_mqprio.c
index f26ba8d7..a128fc11 100644
--- a/tc/q_mqprio.c
+++ b/tc/q_mqprio.c
@@ -243,13 +243,19 @@ static int mqprio_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
 
 	qopt = RTA_DATA(opt);
 
-	fprintf(f, " tc %u map ", qopt->num_tc);
+	print_uint(PRINT_ANY, "tc", "tc %u ", qopt->num_tc);
+	open_json_array(PRINT_ANY, is_json_context() ? "map" : "map ");
 	for (i = 0; i <= TC_PRIO_MAX; i++)
-		fprintf(f, "%u ", qopt->prio_tc_map[i]);
-	fprintf(f, "\n queues:");
-	for (i = 0; i < qopt->num_tc; i++)
-		fprintf(f, "(%u:%u) ", qopt->offset[i],
-			qopt->offset[i] + qopt->count[i] - 1);
+		print_uint(PRINT_ANY, NULL, "%u ", qopt->prio_tc_map[i]);
+	close_json_array(PRINT_ANY, "");
+	open_json_array(PRINT_ANY, is_json_context() ? "queues" : "\n queues:");
+	for (i = 0; i < qopt->num_tc; i++) {
+		open_json_array(PRINT_JSON, NULL);
+		print_uint(PRINT_ANY, NULL, "(%u:", qopt->offset[i]);
+		print_uint(PRINT_ANY, NULL, "%u) ", qopt->offset[i] + qopt->count[i] - 1);
+		close_json_array(PRINT_JSON, NULL);
+	}
+	close_json_array(PRINT_ANY, "");
 
 	if (len > 0) {
 		struct rtattr *tb[TCA_MQPRIO_MAX + 1];
@@ -262,18 +268,18 @@ static int mqprio_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
 			__u16 *mode = RTA_DATA(tb[TCA_MQPRIO_MODE]);
 
 			if (*mode == TC_MQPRIO_MODE_CHANNEL)
-fprintf(f, "\n mode:channel");
+print_string(PRINT_ANY, "mode", "\n mode:%s", "channel");
 		} else {
-			fprintf(f, "\n mode:dcb");
+			print_string(PRINT_ANY, "mode", "\n mode:%s", "dcb");
 		}
 
 		if (tb[TCA_MQPRIO_SHAPER]) {
 			__u16 *shaper = RTA_DATA(tb[TCA_MQPRIO_SHAPER]);
 
 			if (*shaper == TC_MQPRIO_SHAPER_BW_RATE)
-fprintf(f, "\n shaper:bw_rlimit");
+print_string(PRINT_ANY, "shaper", "\n shaper:%s", "bw_rlimit");
 		} else {
-			fprintf(f, "\n shaper:dcb");
+			print_string(PRINT_ANY, "shaper", "\n shaper:%s", "dcb");
 		}
 
 		if (tb[TCA_MQPRIO_MIN_RATE64]) {
@@ -287,9 +293,9 @@ static int mqprio_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
 	return -1;
 *(min++) = rta_getattr_u64(r);
 			}
-			fprintf(f, "	min_rate:");
+			open_json_array(PRINT_ANY, is_json_context() ? "min_rate" : "	min_rate:");
 			for (i = 0; i < qopt->num_tc; i++)
-fprintf(f, "%s ", sprint_rate(min_rate64[i], b1));
+print_string(PRINT_ANY, NULL, "%s ", sprint_rate(min_rate64[i], b1));
 		}
 
 		if (tb[TCA_MQPRIO_MAX_RATE64]) {
@@ -303,9 +309,9 @@ static int mqprio_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
 	return -1;
 *(max++) = rta_getattr_u64(r);
 			}
-			fprintf(f, "	max_rate:");
+			open_json_array(PRINT_ANY, is_json_context() ? "max_rate" : "	max_rate:");
 			for (i = 0; i < qopt->num_tc; i++)
-fprintf(f, "%s ", sprint_rate(max_rate64[i], b1));
+print_string(PRINT_ANY, NULL, "%s ", sprint_rate(max_rate64[i], b1));
 		}
 	}
 	return 0;
-- 
2.29.2



signature.asc
Description: This is a digitally signed message part


Bug#972784: Malformated JSON on tc qdisc

2020-11-27 Thread Luca Boccassi
Control: tags -1 forwarded patch

On Fri, 23 Oct 2020 16:08:31 +0200 =?iso-8859-1?Q?ILEXIA_-_Rom=E9o_GINON?= 
 wrote:
> Package: iproute2
> 
> Version: 4.20.0-2
> 
> Severity : important
> 
>  
> 
> I have some issues with JSON output on tc qdisc.
> 
>  
> 
> Impact : tc command return malformated json when using mqprio with priomap
> or dsmark.
> 
> On both test case ("kind": "dsmark" or "kind": "mqprio" with "root": true)
> associated "options" are not in a valid json format.
> 
>  
> 
>  
> 
> Test Case : 
> 
> 1: /usr/sbin/tc qdisc add dev $IFACE root mqprio num_tc 2 queues 4@0 4@4 hw
> 1 mode channel map 0 0 0 1 0 1 0 0'
> 
> 2: /usr/sbin/tc qdisc add dev $IFACE  handle 1:0 root dsmark indices 64
> set_tc_index
> 
>  
> 
> Command : tc -j -p qdisc show
> 
>  
> 
>  
> 
> 
> Malformated
> 
> 
> {
> 
>  "kind": "mqprio",
> 
>  "handle": "8021:",
> 
>  "dev": "enp1s0f0",
> 
>  "root": true,
> 
>  "options": { tc 2 map 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0
> 
>   queues:(0:3) (4:7)
> 
>   mode:channel
> 
>   shaper:dcb}
> 

I sent a patch upstream to json-ify the output, but I do not have
hardware capable of configuring mqprio.

If you do and want to help test it, it's here:

https://patchwork.ozlabs.org/project/netdev/patch/20201127152625.61874-1-bl...@debian.org/

-- 
Kind regards,
Luca Boccassi


signature.asc
Description: This is a digitally signed message part


Bug#972784: Malformated JSON on tc qdisc

2020-10-23 Thread ILEXIA - Roméo GINON
Package: iproute2

Version: 4.20.0-2

Severity : important

 

I have some issues with JSON output on tc qdisc.

 

Impact : tc command return malformated json when using mqprio with priomap
or dsmark.

On both test case ("kind": "dsmark" or "kind": "mqprio" with "root": true)
associated "options" are not in a valid json format.

 

 

Test Case : 

1: /usr/sbin/tc qdisc add dev $IFACE root mqprio num_tc 2 queues 4@0 4@4 hw
1 mode channel map 0 0 0 1 0 1 0 0'

2: /usr/sbin/tc qdisc add dev $IFACE  handle 1:0 root dsmark indices 64
set_tc_index

 

Command : tc -j -p qdisc show

 

 


Malformated


{

 "kind": "mqprio",

 "handle": "8021:",

 "dev": "enp1s0f0",

 "root": true,

 "options": { tc 2 map 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0

  queues:(0:3) (4:7)

  mode:channel

  shaper:dcb}

 }


Could be correct


{

 "kind": "mqprio",

 "handle": "8021:",

 "dev": "enp1s0f0",

 "root": true,

 "options": { 

  "tc" : 2,

  "map" : [0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],

  "queues": [{0:3},{4:7}],

  "mode":"channel",

  "shaper":"dcb"

 }

 }

 

 

STDOUT malformated : 


[ {

 "kind": "noqueue",

 "handle": "0:",

 "dev": "lo",

 "root": true,

 "refcnt": 2,

 "options": {}

 },{

 "kind": "mqprio",

 "handle": "8021:",

 "dev": "enp1s0f0",

 "root": true,

 "options": { tc 2 map 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0

  queues:(0:3) (4:7)

  mode:channel

  shaper:dcb}

 },{

 "kind": "pfifo_fast",

 "handle": "0:",

 "dev": "enp1s0f0",

 "parent": "8021:8",

 "options": {

 "bands": 3,

 "priomap ": [ 1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1 ],

 "multiqueue": false

 }

 },{

 "kind": "pfifo_fast",

 "handle": "0:",

 "dev": "enp1s0f0",

 "parent": "8021:7",

 "options": {

 "bands": 3,

 "priomap ": [ 1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1 ],

 "multiqueue": false

 }

 },{

 "kind": "pfifo_fast",

 "handle": "0:",

 "dev": "enp1s0f0",

 "parent": "8021:6",

 "options": {

 "bands": 3,

 "priomap ": [ 1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1 ],

 "multiqueue": false

 }

 },{

 "kind": "pfifo_fast",

 "handle": "0:",

 "dev": "enp1s0f0",

 "parent": "8021:5",

 "options": {

 "bands": 3,

 "priomap ": [ 1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1 ],

 "multiqueue": false

 }

 },{

 "kind": "pfifo_fast",

 "handle": "0:",

 "dev": "enp1s0f0",

 "parent": "8021:4",

 "options": {

 "bands": 3,

 "priomap ": [ 1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1 ],

 "multiqueue": false

 }

 },{

 "kind": "pfifo_fast",

 "handle": "0:",

 "dev": "enp1s0f0",

 "parent": "8021:3",

 "options": {

 "bands": 3,

 "priomap ": [ 1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1 ],

 "multiqueue": false

 }

 },{

 "kind": "pfifo_fast",

 "handle": "0:",

 "dev": "enp1s0f0",

 "parent": "8021:2",

 "options": {

 "bands": 3,

 "priomap ": [ 1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1 ],

 "multiqueue": false

 }

 },{

 "kind": "pfifo_fast",

 "handle": "0:",

 "dev": "enp1s0f0",

 "parent": "8021:1",

 "options": {

 "bands": 3,

 "priomap ": [ 1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1 ],

 "multiqueue": false

 }

 },{

 "kind": "pfifo_fast",

 "handle": "0:",

 "dev": "enp0s31f6",

 "root": true,

 "refcnt": 2,

 "options": {

 "bands": 3,

 "priomap ": [ 1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1 ],

 "multiqueue": false

 }

 },{

 "kind": "mqprio",

 "handle": "8001:",

 "dev": "enp1s0f1",

 "root": true,

 "options": { tc 2 map 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0

  queues:(0:3) (4:7)

  mode:channel

  shaper:dcb}

 },{

 "kind": "pfifo_fast",

 "handle": "0:",

 "dev": "enp1s0f1",

 "parent": "8001:8",

 "options": {

 "bands": 3,

 "priomap ": [ 1,2,2,2,1,2,0,0,1,1,1,1,1,1,1,1 ],

 "multiqueue": false

 }

 },{

 "kind": "pfifo_fast",

 "handle": "0:",

 "dev": "enp1s0f1",

 "parent": "8001:7",