[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YOQT9lQuLAvLbaLn@dcaratti.users.ipa.redhat.com>
Date: Tue, 6 Jul 2021 10:27:34 +0200
From: Davide Caratti <dcaratti@...hat.com>
To: Hangbin Liu <liuhangbin@...il.com>
Cc: Roi Dayan <roid@...dia.com>, netdev@...r.kernel.org,
Paul Blakey <paulb@...dia.com>,
David Ahern <dsahern@...il.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 Mon, Jul 05, 2021 at 06:41:37PM +0800, Hangbin Liu wrote:
> On Mon, Jun 07, 2021 at 09:44:08AM +0300, Roi Dayan wrote:
> > Change to use the print wrappers instead of fprintf().
> >
> > Signed-off-by: Roi Dayan <roid@...dia.com>
> > Reviewed-by: Paul Blakey <paulb@...dia.com>
> > ---
hello Hangbin,
[...]
> >
> > @@ -300,13 +301,13 @@ static int print_police(struct action_util *a, FILE *f, struct rtattr *arg)
> > RTA_PAYLOAD(tb[TCA_POLICE_RATE64]) >= sizeof(rate64))
> > rate64 = rta_getattr_u64(tb[TCA_POLICE_RATE64]);
> >
> > - fprintf(f, " police 0x%x ", p->index);
> > + print_uint(PRINT_ANY, "index", "\t index %u ", p->index);
>
> Hi everyone,
>
> This update break all policy checking in kernel tc selftest actions/police.json.
> As the new output would like
thanks for catching this!
> total acts 1
>
> action order 0: police index 1 rate 1Kbit burst 10Kb mtu 2Kb action reclassify overhead 0 ref 1 bind 0
>
>
> And the current test checks like
>
> "matchPattern": "action order [0-9]*: police 0x1 rate 1Kbit burst 10Kb"
>
> I plan to update the kselftest to mach the new output.
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?
thanks,
--
davide
Powered by blists - more mailing lists