Subject: Re: ynl - mutiple policies for one nested attr used in multiple cmds

From: Jakub Kicinski <[email-masked]>
Date: Fri, 18 Aug 2023 13:24:47 -0700

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/[email-masked]/
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.

Option #2 is to not use the auto-generated policy, and write the policy
by hand in the kernel with the right members.

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.