Bug#972784: Malformated JSON on tc qdisc

2020-11-28 Thread romeo.ginon
Hello Luca,

 

Looks great with a valid json syntax.

 


tc -j 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 -j qdisc


[{"kind":"noqueue","handle":"0:","dev":"lo","root":true,"refcnt":2,"options":{}},{"kind":"mqprio","handle":"8001:","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":"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":"enp1s0f0","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:","dev":"enp1s0f0","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:","dev":"enp1s0f0","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:","dev":"enp1s0f0","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:","dev":"enp1s0f0","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:","dev":"enp1s0f0","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:","dev":"enp1s0f0","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}},{"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":"mq","handle":"0:","dev":"enp1s0f1","root":true,"options":{}},{"kind":"pfifo_fast","handle":"0:","dev":"enp1s0f1","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":"enp1s0f1","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":"enp1s0f1","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":"enp1s0f1","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":"enp1s0f1","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":"enp1s0f1","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":"enp1s0f1","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":"enp1s0f1","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":"enp1s0f1","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":"enp1s0f1","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":"enp1s0f1","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":"enp1s0f1","parent":":5","options":{"bands":3,"priomap
 
":[1,2,2,2,1,2,0,0,1,1,1

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