netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Wen Liang <liangwen12year@gmail.com>
Cc: netdev@vger.kernel.org, dsahern@gmail.com, aclaudi@redhat.com
Subject: Re: [PATCH iproute2 v3 1/2] tc: u32: add support for json output
Date: Thu, 6 Jan 2022 14:30:13 -0800	[thread overview]
Message-ID: <20220106143013.63e5a910@hermes.local> (raw)
In-Reply-To: <0670d2ea02d2cbd6d1bc755a814eb8bca52ccfba.1641493556.git.liangwen12year@gmail.com>

On Thu,  6 Jan 2022 13:45:51 -0500
Wen Liang <liangwen12year@gmail.com> wrote:

>  	} else if (sel && sel->flags & TC_U32_TERMINAL) {
> -		fprintf(f, "terminal flowid ??? ");
> +		print_bool(PRINT_ANY, "terminal_flowid", "terminal flowid ??? ", true);

This looks like another error (ie to stderr) like the earlier case

>  	if (tb[TCA_U32_LINK]) {
>  		SPRINT_BUF(b1);
> -		fprintf(f, "link %s ",
> -			sprint_u32_handle(rta_getattr_u32(tb[TCA_U32_LINK]),
> +		print_string(PRINT_ANY, "link", "link %s ", sprint_u32_handle(rta_getattr_u32(tb[TCA_U32_LINK]),
>  					  b1));

Break that long line up. Would look better with a temporary variable.

FYI - good test is to run the json output into python's json parser to make sure it is valid.

  reply	other threads:[~2022-01-06 22:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-06 18:45 [PATCH iproute2 v3 0/2] add json support on tc u32 Wen Liang
2022-01-06 18:45 ` [PATCH iproute2 v3 1/2] tc: u32: add support for json output Wen Liang
2022-01-06 22:30   ` Stephen Hemminger [this message]
2022-01-07 16:54     ` David Ahern
2022-01-24 18:25     ` Andrea Claudi
2022-01-24 18:50       ` Stephen Hemminger
2022-01-24 21:30         ` Andrea Claudi
2022-01-25  0:43           ` Stephen Hemminger
2022-01-26 13:52             ` Jamal Hadi Salim
2022-01-26 15:50               ` David Ahern
2022-01-31 12:54                 ` Jamal Hadi Salim
2022-01-31 15:50                   ` David Ahern
2022-01-31 19:37                     ` Jamal Hadi Salim
2022-01-06 18:45 ` [PATCH iproute2 v3 2/2] tc: u32: add json support in `print_raw`, `print_ipv4`, `print_ipv6` Wen Liang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220106143013.63e5a910@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=aclaudi@redhat.com \
    --cc=dsahern@gmail.com \
    --cc=liangwen12year@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).