From: Stephen Hemminger <stephen@networkplumber.org>
To: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
Cc: netdev@vger.kernel.org, jhs@mojatatu.com,
xiyou.wangcong@gmail.com, jiri@resnulli.us,
Vinicius Costa Gomes <vinicius.gomes@intel.com>
Subject: Re: [RFC v3 iproute2 3/3] tc: Add support for the TBS Qdisc
Date: Tue, 6 Mar 2018 17:51:49 -0800 [thread overview]
Message-ID: <20180306175149.223614ab@xeon-e3> (raw)
In-Reply-To: <20180307011608.24186-3-jesus.sanchez-palencia@intel.com>
On Tue, 6 Mar 2018 17:16:08 -0800
Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com> 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.
next prev parent reply other threads:[~2018-03-07 1:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-07 1:16 [RFC v3 iproute2 1/3] include: Add ptp_clock.h to linux uapi Jesus Sanchez-Palencia
2018-03-07 1:16 ` [RFC v3 iproute2 2/3] uapi pkt_sched: Add tbs info - DO NOT COMMIT Jesus Sanchez-Palencia
2018-03-07 1:16 ` [RFC v3 iproute2 3/3] tc: Add support for the TBS Qdisc Jesus Sanchez-Palencia
2018-03-07 1:51 ` Stephen Hemminger [this message]
2018-03-07 22:29 ` Jesus Sanchez-Palencia
2018-03-07 22:53 ` Stephen Hemminger
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=20180306175149.223614ab@xeon-e3 \
--to=stephen@networkplumber.org \
--cc=jesus.sanchez-palencia@intel.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=netdev@vger.kernel.org \
--cc=vinicius.gomes@intel.com \
--cc=xiyou.wangcong@gmail.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.