From: Petr Machata <petrm@nvidia.com>
To: <Daniel.Machon@microchip.com>
Cc: <petrm@nvidia.com>, <netdev@vger.kernel.org>,
<dsahern@kernel.org>, <stephen@networkplumber.org>,
<maxime.chevallier@bootlin.com>, <vladimir.oltean@nxp.com>,
<UNGLinuxDriver@microchip.com>
Subject: Re: [PATCH iproute2-next 2/2] dcb: add new subcommand for apptrust
Date: Fri, 25 Nov 2022 14:06:36 +0100 [thread overview]
Message-ID: <87fse7i3et.fsf@nvidia.com> (raw)
In-Reply-To: <Y4CJWeNMMacAwHiL@DEN-LT-70577>
<Daniel.Machon@microchip.com> writes:
>> > +static int dcb_apptrust_parse_selector_list(int *argcp, char ***argvp,
>> > + struct dcb_apptrust_table *table)
>> > +{
>> > + char **argv = *argvp;
>> > + int argc = *argcp;
>> > + __u8 selector;
>> > + int ret;
>> > +
>> > + NEXT_ARG_FWD();
>> > +
>> > + /* No trusted selectors ? */
>> > + if (argc == 0)
>> > + goto out;
>> > +
>> > + while (argc > 0) {
>> > + selector = parse_one_of("order", *argv, selector_names,
>> > + ARRAY_SIZE(selector_names), &ret);
>> > + if (ret < 0)
>> > + return -EINVAL;
>>
>> I think this should legitimately conclude the parsing, because it could
>> be one of the higher-level keywords. Currently there's only one,
>> "order", but nonetheless. I think it should goto out, and be plonked by
>> the caller with "what is X?". Similar to how the first argument that
>> doesn't parse as e.g. DSCP:PRIO bails out and is attempted as a keyword
>> higher up, and either parsed, or plonked with "what is X".
>
> I dont quite follow you on this one. We are parsing the selector list
> here. Any offending selector is printed, as well as the entire list of
> valid ones. How could it be one of the higher-level keywords? Am I
> missing something here? :-)
Imagine there's more to specify than order. Say, per-selector rewrite
enablement or something. Then the command-line to specify both at the
same time could look like this:
# dcb apptrust set dev eth0 order dscp pcp rewrite dscp:on pcp:off
I think that currently the "rewrite" keyword will trigger the -EINVAL
return above and the whole command line will be rejected.
Right now it's all the same, because there's only one thing to
configure, but it would be cleaner to handle this case as if there could
be more things to configure.
prev parent reply other threads:[~2022-11-25 13:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-22 10:41 [PATCH iproute2-next 0/2] Add pcp-prio and new apptrust subcommand Daniel Machon
2022-11-22 10:41 ` [PATCH iproute2-next 1/2] dcb: add new pcp-prio parameter to dcb app Daniel Machon
2022-11-24 15:30 ` Petr Machata
2022-11-24 16:11 ` Petr Machata
2022-11-24 16:53 ` Petr Machata
2022-11-25 10:07 ` Daniel.Machon
2022-11-25 13:12 ` Petr Machata
2022-11-22 10:41 ` [PATCH iproute2-next 2/2] dcb: add new subcommand for apptrust Daniel Machon
2022-11-24 16:16 ` Petr Machata
2022-11-25 9:11 ` Daniel.Machon
2022-11-25 13:06 ` Petr Machata [this message]
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=87fse7i3et.fsf@nvidia.com \
--to=petrm@nvidia.com \
--cc=Daniel.Machon@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=dsahern@kernel.org \
--cc=maxime.chevallier@bootlin.com \
--cc=netdev@vger.kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).