From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roman Mashak Subject: Re: [PATCH iproute2-next] tc: Correct json output for actions Date: Wed, 04 Apr 2018 17:09:04 -0400 Message-ID: <858ta2brwv.fsf@mojatatu.com> References: <1522844653-37136-1-git-send-email-yuvalm@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain Cc: dsahern@gmail.com, mlxsw@mellanox.com, netdev@vger.kernel.org To: Yuval Mintz Return-path: Received: from mail-it0-f48.google.com ([209.85.214.48]:37459 "EHLO mail-it0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751749AbeDDVJI (ORCPT ); Wed, 4 Apr 2018 17:09:08 -0400 Received: by mail-it0-f48.google.com with SMTP id 71-v6so504823ith.2 for ; Wed, 04 Apr 2018 14:09:07 -0700 (PDT) In-Reply-To: <1522844653-37136-1-git-send-email-yuvalm@mellanox.com> (Yuval Mintz's message of "Wed, 4 Apr 2018 15:24:13 +0300") Sender: netdev-owner@vger.kernel.org List-ID: Yuval Mintz writes: > Commit 9fd3f0b255d9 ("tc: enable json output for actions") added JSON > support for tc-actions at the expense of breaking other use cases that > reach tc_print_action(), as the latter don't expect the 'actions' array > to be a new object. > > Consider the following taken duringrun of tc_chain.sh selftest, > and see the latter command output is broken: > > $ ./tc/tc -j -p actions list action gact | grep -C 3 actions > [ { > "total acts": 1 > },{ > "actions": [ { > "order": 0, > > $ ./tc/tc -p -j -s filter show dev enp3s0np2 ingress | grep -C 3 actions > }, > "skip_hw": true, > "not_in_hw": true,{ > "actions": [ { > "order": 1, > "kind": "gact", > "control_action": { > > Relocate the open/close of the JSON object to declare the object only > for the case that needs it. > > Signed-off-by: Yuval Mintz [...] Good catch, thanks Yuval. Tested-by: Roman Mashak