From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f173.google.com ([209.85.192.173]:36774 "EHLO mail-pf0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754500AbeCGWx1 (ORCPT ); Wed, 7 Mar 2018 17:53:27 -0500 Received: by mail-pf0-f173.google.com with SMTP id 68so1558941pfx.3 for ; Wed, 07 Mar 2018 14:53:26 -0800 (PST) Date: Wed, 7 Mar 2018 14:53:19 -0800 From: Stephen Hemminger To: Jesus Sanchez-Palencia Cc: netdev@vger.kernel.org, jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us, Vinicius Costa Gomes Subject: Re: [RFC v3 iproute2 3/3] tc: Add support for the TBS Qdisc Message-ID: <20180307145319.3e0d4470@xeon-e3> In-Reply-To: References: <20180307011608.24186-1-jesus.sanchez-palencia@intel.com> <20180307011608.24186-3-jesus.sanchez-palencia@intel.com> <20180306175149.223614ab@xeon-e3> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org List-ID: On Wed, 7 Mar 2018 14:29:23 -0800 Jesus Sanchez-Palencia wrote: > Hi, > > > On 03/06/2018 05:51 PM, Stephen Hemminger wrote: > > On Tue, 6 Mar 2018 17:16:08 -0800 > > Jesus Sanchez-Palencia wrote: > > > >> atic int tbs_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt) > >> +{ > >> + struct rtattr *tb[TCA_TBS_MAX+1]; > >> + struct tc_tbs_qopt *qopt; > >> + > >> + if (opt == NULL) > >> + return 0; > >> + > >> + parse_rtattr_nested(tb, TCA_TBS_MAX, opt); > >> + > >> + if (tb[TCA_TBS_PARMS] == NULL) > >> + return -1; > >> + > >> + qopt = RTA_DATA(tb[TCA_TBS_PARMS]); > >> + if (RTA_PAYLOAD(tb[TCA_TBS_PARMS]) < sizeof(*qopt)) > >> + return -1; > >> + > >> + fprintf(f, "clockid "); > >> + if (qopt->clockid == CLOCKID_INVALID) > >> + fprintf(f, "invalid "); > >> + else > >> + fprintf(f, "%d ", qopt->clockid); > >> + > >> + fprintf(f, "delta %d ", qopt->delta); > >> + fprintf(f, "offload %s ", (qopt->flags & TC_TBS_OFFLOAD_ON) ? > >> + "on" : "off"); > >> + fprintf(f, "sorting %s", (qopt->flags & TC_TBS_SORTING_ON) ? > >> + "on" : "off"); > >> + > >> + return 0; > >> +} > > > > All new print code in iproute2 should support JSON output. > > Look at other code using json_print.h for simple way to handle this. > > > > > Fixed, thanks. I'm assuming that only applies to print code from print_qopt() > implementations. Please let me know if otherwise. > Yes. that is what gets invoked by 'tc qdisc show'. Not everything is updated, but want to get there soon.