[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <37a0aae7-d32b-4dfd-9832-5b443d73abb6@nvidia.com>
Date: Sun, 11 Jul 2021 13:24:45 +0300
From: Roi Dayan <roid@...dia.com>
To: David Ahern <dsahern@...il.com>,
Hangbin Liu <liuhangbin@...il.com>,
Davide Caratti <dcaratti@...hat.com>
CC: <netdev@...r.kernel.org>, Paul Blakey <paulb@...dia.com>,
"Stephen Hemminger" <stephen@...workplumber.org>,
Jamal Hadi Salim <jhs@...atatu.com>,
Roman Mashak <mrv@...atatu.com>,
Baowen Zheng <baowen.zheng@...igine.com>
Subject: Re: [PATCH iproute2-next v4 1/1] police: Add support for json output
On 2021-07-08 5:46 PM, David Ahern wrote:
> On 7/8/21 12:57 AM, Roi Dayan wrote:
>>
>>
>> On 2021-07-07 9:53 AM, Hangbin Liu wrote:
>>> On Tue, Jul 06, 2021 at 10:27:34AM +0200, Davide Caratti wrote:
>>>> my 2 cents:
>>>>
>>>> what about using PRINT_FP / PRINT_JSON, so we fix the JSON output
>>>> only to show "index", and
>>>> preserve the human-readable printout iproute and kselftests? besides
>>>> avoiding failures because
>>>> of mismatching kselftests / iproute, this would preserve
>>>> functionality of scripts that
>>>> configure / dump the "police" action. WDYT?
>>>
>>> +1
>>>
>>
>>
>> why not fix the kselftest to look for the correct output?
>
> That is but 1 user. The general rule is that you do not change the
> output like you did.
>
but the output was "broken" and not consistent with all actions.
we are not fixing this kind of thing?
so to continue with the suggestion to use print_fp and keep police
action output broken and print_json for the json output?
just to be sure before submitting change back to old output for fp.
...
action order 1: police 0x1 rate 1Mbit burst 20Kb mtu 2Kb
action reclassify overhead 0b
- print_string(PRINT_ANY, "kind", "%s", "police");
+ print_string(PRINT_JSON, "kind", "%s", "police");
- print_uint(PRINT_ANY, "index", "\tindex %u ", p->index);
+ print_hex(PRINT_FP, NULL, " police 0x%x ", p->index);
+ print_uint(PRINT_JSON, "index", NULL, p->index);
Powered by blists - more mailing lists