[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <eeyl5eri5dqeir5at4fpcbb3zsanrbfbx7janiz6ntf6ffk5m7@q5ensvdqfvrl>
Date: Tue, 29 Apr 2025 09:22:23 +0200
From: Jiri Pirko <jiri@...nulli.us>
To: Jakub Kicinski <kuba@...nel.org>
Cc: Saeed Mahameed <saeed@...nel.org>,
"David S. Miller" <davem@...emloft.net>, Paolo Abeni <pabeni@...hat.com>,
Eric Dumazet <edumazet@...gle.com>, Saeed Mahameed <saeedm@...dia.com>, netdev@...r.kernel.org,
Tariq Toukan <tariqt@...dia.com>, Gal Pressman <gal@...dia.com>,
Leon Romanovsky <leonro@...dia.com>, Jiri Pirko <jiri@...dia.com>
Subject: Re: [PATCH net-next V3 01/15] tools: ynl-gen: allow noncontiguous
enums
Tue, Apr 29, 2025 at 01:06:11AM +0200, kuba@...nel.org wrote:
>On Fri, 25 Apr 2025 14:47:54 -0700 Saeed Mahameed wrote:
>> In case the enum has holes, instead of hard stop, avoid the policy value
>> checking and it to the code.
>
>We guarantee that YNL generates full type validation for enum types.
>IOW that the policy will reject values outside of the enum.
>We need to preserve this guarantee.
>Best we can do for sparse enums is probably to generate a function
>callback that does the checking.
Okay, will do that.
>We could add something like a bitmap validation for small sparse values
>(treat the mask in the policy as mask of allowed values).
>But hard to justify the complexity with just a single case of the
>problem. (actually classic netlink has a similar problem for AF_*
>values, but there "->mask as a bitmap" validation don't do, since
>the elements of the enum go up to 256).
>
Powered by blists - more mailing lists