[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b2d21f24-2b76-710c-f895-2c803ffa4d78@gmail.com>
Date: Thu, 10 Jun 2021 20:35:05 -0600
From: David Ahern <dsahern@...il.com>
To: Roi Dayan <roid@...dia.com>, netdev@...r.kernel.org
Cc: Paul Blakey <paulb@...dia.com>,
Stephen Hemminger <stephen@...workplumber.org>,
Jamal Hadi Salim <jhs@...atatu.com>
Subject: Re: [PATCH iproute2-next v4 1/1] police: Add support for json output
On 6/7/21 12:44 AM, Roi Dayan wrote:
> Change to use the print wrappers instead of fprintf().
>
> This is example output of the options part before this commit:
>
> "options": {
> "handle": 1,
> "in_hw": true,
> "actions": [ {
> "order": 1 police 0x2 ,
> "control_action": {
> "type": "drop"
> },
> "control_action": {
> "type": "continue"
> }overhead 0b linklayer unspec
> ref 1 bind 1
> ,
> "used_hw_stats": [ "delayed" ]
> } ]
> }
>
> This is the output of the same dump with this commit:
>
> "options": {
> "handle": 1,
> "in_hw": true,
> "actions": [ {
> "order": 1,
> "kind": "police",
> "index": 2,
> "control_action": {
> "type": "drop"
> },
> "control_action": {
> "type": "continue"
> },
> "overhead": 0,
> "linklayer": "unspec",
> "ref": 1,
> "bind": 1,
> "used_hw_stats": [ "delayed" ]
> } ]
> }
>
> Signed-off-by: Roi Dayan <roid@...dia.com>
> Reviewed-by: Paul Blakey <paulb@...dia.com>
> ---
>
> Notes:
> v2
> - fix json output to match correctly the other actions
> i.e. output the action name in key 'kind' and unsigned for the index
>
> v3
> - print errors to stderr.
> - return -1 on null key.
>
> v4
> - removed left over debug that was forgotten. sorry for that.
>
> tc/m_police.c | 30 +++++++++++++++++-------------
> 1 file changed, 17 insertions(+), 13 deletions(-)
>
applied to iproute2-next
Powered by blists - more mailing lists