public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Luca Boccassi <bluca@debian.org>, netdev@vger.kernel.org
Cc: stephen@networkplumber.org
Subject: Re: [PATCH iproute2 v2] tc/mqprio: json-ify output
Date: Wed, 2 Dec 2020 09:42:22 -0700	[thread overview]
Message-ID: <77134dfe-8e5f-5bcc-25b4-dde91cf3492c@gmail.com> (raw)
In-Reply-To: <20201128183015.15889-1-bluca@debian.org>

On 11/28/20 11:30 AM, Luca Boccassi wrote:
> @@ -287,9 +293,9 @@ static int mqprio_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
>  					return -1;
>  				*(min++) = rta_getattr_u64(r);
>  			}
> -			fprintf(f, "	min_rate:");
> +			open_json_array(PRINT_ANY, is_json_context() ? "min_rate" : "	min_rate:");
>  			for (i = 0; i < qopt->num_tc; i++)
> -				fprintf(f, "%s ", sprint_rate(min_rate64[i], b1));
> +				print_string(PRINT_ANY, NULL, "%s ", sprint_rate(min_rate64[i], b1));

close_json_array?

>  		}
>  
>  		if (tb[TCA_MQPRIO_MAX_RATE64]) {
> @@ -303,9 +309,9 @@ static int mqprio_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
>  					return -1;
>  				*(max++) = rta_getattr_u64(r);
>  			}
> -			fprintf(f, "	max_rate:");
> +			open_json_array(PRINT_ANY, is_json_context() ? "max_rate" : "	max_rate:");
>  			for (i = 0; i < qopt->num_tc; i++)
> -				fprintf(f, "%s ", sprint_rate(max_rate64[i], b1));
> +				print_string(PRINT_ANY, NULL, "%s ", sprint_rate(max_rate64[i], b1));
>  		}

close_json_array?

>  	}
>  	return 0;
> 


  reply	other threads:[~2020-12-02 16:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-27 15:26 [RFC iproute2] tc/mqprio: json-ify output Luca Boccassi
2020-11-28  5:21 ` Stephen Hemminger
2020-11-28 12:17   ` Luca Boccassi
2020-11-28 17:34     ` Stephen Hemminger
2020-11-28 17:59       ` Luca Boccassi
2020-11-28 12:21 ` [PATCH iproute2 v2] " Luca Boccassi
2020-11-28 15:24   ` Luca Boccassi
2020-11-28 18:30 ` Luca Boccassi
2020-12-02 16:42   ` David Ahern [this message]
2020-12-02 17:09     ` Luca Boccassi
2020-12-02 17:08   ` [PATCH v3] " luca.boccassi
2020-12-03 16:40     ` patchwork-bot+netdevbpf

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=77134dfe-8e5f-5bcc-25b4-dde91cf3492c@gmail.com \
    --to=dsahern@gmail.com \
    --cc=bluca@debian.org \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.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