netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* iproute2/tc invalid JSON in 6.0.0 for flowid
@ 2022-10-13 11:17 Christian Pössinger
  2022-10-13 15:18 ` Francois Romieu
  2022-10-13 15:32 ` [PATCH iproute2] u32: fix json formatting of flowid Stephen Hemminger
  0 siblings, 2 replies; 5+ messages in thread
From: Christian Pössinger @ 2022-10-13 11:17 UTC (permalink / raw)
  To: 'netdev@vger.kernel.org'

Dear Maintainers,

I am new to the reporting process for iproute2 and this is only my second post
thus please bear with me and my MTA.

  $ tc -V
  tc utility, iproute2-6.0.0, libbpf 0.3.0

  $ tc qdisc add dev eth1 handle ffff: ingress
  $ tc filter add dev eth1 parent ffff: prio 20 protocol all u32 match ip dport 80 \
       0xffff action police rate 100000 conform-exceed drop burst 15k flowid ffff:1

  $ tc qdisc show dev eth1
  qdisc mq 0: root
  qdisc pfifo_fast 0: parent :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 :1 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
  qdisc ingress ffff: parent ffff:fff1 ----------------
  
  $ tc filter show dev eth1 ingress
  filter parent ffff: protocol all pref 20 u32 chain 0
  filter parent ffff: protocol all pref 20 u32 chain 0 fh 800: ht divisor 1
  filter parent ffff: protocol all pref 20 u32 chain 0 fh 800::800 order 2048 key ht 800 bkt 0 flowid ffff:1 not_in_hw
    match 00000050/0000ffff at 20
          action order 1:  police 0x1 rate 100Kbit burst 15Kb mtu 2Kb action drop overhead 0b
          ref 1 bind 1
   
  That output looks good but my use-case is machine reading (JSON) the output
  of tc.
  
  $ tc -json filter show dev eth1 ingress
  [{"parent":"ffff:","protocol":"all","pref":20,"kind":"u32","chain":0},
   {"parent":"ffff:","protocol":"all","pref":20,"kind":"u32","chain":0,"options":{"fh":"800:","ht_divisor":1}},
   {"parent":"ffff:","protocol":"all","pref":20,"kind":"u32","chain":0,"options":{"fh":"800::800","order":2048,"key_ht":"800","bkt":"0"flowid ffff:1 ,"not_in_hw":true,"match":{"value":"50","mask":"ffff","offmask":"","off":20},"actions":[{"order":1,"kind":"police","index":1,"control_action":{"type":"drop"},"overhead":0,"ref":1,"bind":1}]}}]
   
This actually contains invalid JSON here

... "bkt":"0"flowid ffff:1 ,"not_in_hw":true, ...

It should actually read:

... "bkt":"0","flowid":"ffff:1","not_in_hw":true, ...

If you can point me to the location which could be responsible for this issue, I am happy to submit a fix to the net tree.

Thanks in advance,
Christian Poessinger

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

end of thread, other threads:[~2022-10-13 17:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-13 11:17 iproute2/tc invalid JSON in 6.0.0 for flowid Christian Pössinger
2022-10-13 15:18 ` Francois Romieu
2022-10-13 15:43   ` Stephen Hemminger
2022-10-13 15:32 ` [PATCH iproute2] u32: fix json formatting of flowid Stephen Hemminger
2022-10-13 17:22   ` Christian Pössinger

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