From: Jiri Pirko <jiri@resnulli.us>
To: Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org
Subject: Re: ynl - mutiple policies for one nested attr used in multiple cmds
Date: Mon, 21 Aug 2023 13:16:52 +0200 [thread overview]
Message-ID: <ZONHpD7CPEWoQEq2@nanopsycho> (raw)
In-Reply-To: <20230818132447.32d32df6@kernel.org>
Fri, Aug 18, 2023 at 10:24:47PM CEST, kuba@kernel.org wrote:
>On Fri, 18 Aug 2023 20:11:16 +0200 Jiri Pirko wrote:
>> Okay, you don't have good solution, do you have at least the least bad
>> one? :)
>
>I was pondering this for the recent pp work:
>https://lore.kernel.org/all/20230816234303.3786178-13-kuba@kernel.org/
>search for NL_SET_ERR_MSG_ATTR.
>
>I ended up hand-rejecting the attrs which I didn't want.
>It's not great because the policy (netdev_page_pool_info_nl_policy)
>is shared so if someone adds stuff there they'll need to know
>to update all the rejects :[
>
>I guess a better way to code up the same idea would be to check if tb[]
>is NULL outside of expected attrs.
The problem is that with devlink, there no nostrict parsing. So the
like-to-be-ignored attrs if passed might error out during validation.
>
>Option #2 is to not use the auto-generated policy, and write the policy
>by hand in the kernel with the right members.
I'll go with this option for now I think.
>
>Option #3 is to add support for this to the YAML. With the existing
>concepts we would have to redefine all levels as subsets, and then
>we can override nested-attributes. A lot of typing. The YAML is really
>just a slightly decorated version of the policy tables. The policy
>tables in this case have to be separate.
Yeah. But eventually, I think this would be needed anyway to make yaml
to handle all the cases. Relying on the developer to do option #1 or #2
kinda defeats the inital yaml goal to avoid people mistakes, I think.
prev parent reply other threads:[~2023-08-21 11:16 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-04 17:29 ynl - mutiple policies for one nested attr used in multiple cmds Jiri Pirko
2023-08-04 19:58 ` Jakub Kicinski
2023-08-05 6:33 ` Jiri Pirko
2023-08-07 17:03 ` Jakub Kicinski
2023-08-07 17:12 ` Jiri Pirko
2023-08-07 17:24 ` Jakub Kicinski
2023-08-08 7:38 ` Jiri Pirko
2023-08-18 8:37 ` Jiri Pirko
2023-08-18 15:55 ` Jakub Kicinski
2023-08-18 18:11 ` Jiri Pirko
2023-08-18 20:24 ` Jakub Kicinski
2023-08-21 11:16 ` Jiri Pirko [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=ZONHpD7CPEWoQEq2@nanopsycho \
--to=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
/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.