From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jakub Kicinski Subject: Re: [PATCH iproute2-next] tc: jsonify output of q_fifo Date: Thu, 4 Oct 2018 17:31:10 -0700 Message-ID: <20181004173110.4a6a37c4@cakuba.netronome.com> References: <20181005000834.24364-1-jakub.kicinski@netronome.com> <20181004171058.0bd85fdb@xeon-e3> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dsahern@gmail.com, netdev@vger.kernel.org, oss-drivers@netronome.com To: Stephen Hemminger Return-path: Received: from mail-qt1-f195.google.com ([209.85.160.195]:33162 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726894AbeJEH1U (ORCPT ); Fri, 5 Oct 2018 03:27:20 -0400 Received: by mail-qt1-f195.google.com with SMTP id q40-v6so12108048qte.0 for ; Thu, 04 Oct 2018 17:31:15 -0700 (PDT) In-Reply-To: <20181004171058.0bd85fdb@xeon-e3> Sender: netdev-owner@vger.kernel.org List-ID: On Thu, 4 Oct 2018 17:10:58 -0700, Stephen Hemminger wrote: > On Thu, 4 Oct 2018 17:08:34 -0700 > Jakub Kicinski wrote: > > > Print limits correctly in JSON context. > > > > Signed-off-by: Jakub Kicinski > > --- > > 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. No preference on my side, should I resend? (Apologies for not CCing you!)