From: <Daniel.Machon@microchip.com>
To: <stephen@networkplumber.org>
Cc: <netdev@vger.kernel.org>, <dsahern@kernel.org>,
<petrm@nvidia.com>, <maxime.chevallier@bootlin.com>,
<vladimir.oltean@nxp.com>, <UNGLinuxDriver@microchip.com>
Subject: Re: [PATCH iproute2-next v3 1/2] dcb: add new pcp-prio parameter to dcb app
Date: Sun, 4 Dec 2022 22:27:40 +0000 [thread overview]
Message-ID: <Y40hjAoN4VcUCatp@DEN-LT-70577> (raw)
In-Reply-To: <20221203090052.65ff3bf1@hermes.local>
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> On Fri, 2 Dec 2022 10:22:34 +0100
> Daniel Machon <daniel.machon@microchip.com> wrote:
>
> > +static int dcb_app_print_key_pcp(__u16 protocol)
> > +{
> > + /* Print in numerical form, if protocol value is out-of-range */
> > + if (protocol > DCB_APP_PCP_MAX) {
> > + fprintf(stderr, "Unknown PCP key: %d\n", protocol);
> > + return print_uint(PRINT_ANY, NULL, "%d:", protocol);
> > + }
> > +
> > + return print_string(PRINT_ANY, NULL, "%s:", pcp_names[protocol]);
> > +}
>
> This is not an application friendly way to produce JSON output.
> You need to put a key on each one, and value should not contain colon.
Hi Stephen,
Trying to understand your comment.
Are you talking about not producing any JSON output with the symbolic
PCP values? eg. ["1de", 1] -> [8, 1]. So basically print with PRINT_FP
in case of printing in JSON context?
/Daniel
next prev parent reply other threads:[~2022-12-04 22:27 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-02 9:22 [PATCH iproute2-next v3 0/2] Add pcp-prio and new apptrust subcommand Daniel Machon
2022-12-02 9:22 ` [PATCH iproute2-next v3 1/2] dcb: add new pcp-prio parameter to dcb app Daniel Machon
2022-12-03 17:00 ` Stephen Hemminger
2022-12-04 22:27 ` Daniel.Machon [this message]
2022-12-05 1:52 ` Stephen Hemminger
2022-12-05 9:19 ` Daniel.Machon
2022-12-05 16:23 ` Stephen Hemminger
2022-12-05 19:19 ` Daniel.Machon
2022-12-05 21:05 ` Stephen Hemminger
2022-12-06 8:55 ` Petr Machata
2022-12-02 9:22 ` [PATCH iproute2-next v3 2/2] dcb: add new subcommand for apptrust Daniel Machon
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=Y40hjAoN4VcUCatp@DEN-LT-70577 \
--to=daniel.machon@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=dsahern@kernel.org \
--cc=maxime.chevallier@bootlin.com \
--cc=netdev@vger.kernel.org \
--cc=petrm@nvidia.com \
--cc=stephen@networkplumber.org \
--cc=vladimir.oltean@nxp.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox