From: Stephen Hemminger <stephen@networkplumber.org>
To: Jakub Kicinski <jakub.kicinski@netronome.com>
Cc: dsahern@gmail.com, netdev@vger.kernel.org, oss-drivers@netronome.com
Subject: Re: [PATCH iproute2-next] tc: jsonify output of q_fifo
Date: Thu, 4 Oct 2018 17:10:58 -0700 [thread overview]
Message-ID: <20181004171058.0bd85fdb@xeon-e3> (raw)
In-Reply-To: <20181005000834.24364-1-jakub.kicinski@netronome.com>
On Thu, 4 Oct 2018 17:08:34 -0700
Jakub Kicinski <jakub.kicinski@netronome.com> wrote:
> Print limits correctly in JSON context.
>
> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
> ---
> tc/q_fifo.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/tc/q_fifo.c b/tc/q_fifo.c
> index cb86a404d4de..61493fbbc5bc 100644
> --- a/tc/q_fifo.c
> +++ b/tc/q_fifo.c
> @@ -69,9 +69,12 @@ static int fifo_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
> qopt = RTA_DATA(opt);
> if (strcmp(qu->id, "bfifo") == 0) {
> SPRINT_BUF(b1);
> - fprintf(f, "limit %s", sprint_size(qopt->limit, b1));
> - } else
> - fprintf(f, "limit %up", qopt->limit);
> + print_uint(PRINT_JSON, "limit", NULL, qopt->limit);
> + print_string(PRINT_FP, NULL, "limit %s",
> + sprint_size(qopt->limit, b1));
> + } else {
> + print_uint(PRINT_ANY, "limit", "limit %up", qopt->limit);
> + }
> return 0;
> }
>
This can go to current not net-next, since it is a bug fix really.
next prev parent reply other threads:[~2018-10-05 7:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-05 0:08 [PATCH iproute2-next] tc: jsonify output of q_fifo Jakub Kicinski
2018-10-05 0:10 ` Stephen Hemminger [this message]
2018-10-05 0:31 ` Jakub Kicinski
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=20181004171058.0bd85fdb@xeon-e3 \
--to=stephen@networkplumber.org \
--cc=dsahern@gmail.com \
--cc=jakub.kicinski@netronome.com \
--cc=netdev@vger.kernel.org \
--cc=oss-drivers@netronome.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.