[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <m2wmxkfuve.fsf@gmail.com>
Date: Thu, 24 Aug 2023 14:11:17 +0100
From: Donald Hunter <donald.hunter@...il.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: davem@...emloft.net, netdev@...r.kernel.org, edumazet@...gle.com,
pabeni@...hat.com
Subject: Re: [PATCH net-next 3/5] tools: ynl-gen: fix collecting global
policy attrs
Jakub Kicinski <kuba@...nel.org> writes:
> We look for attributes inside do.request, but there's another
> layer of nesting in the spec, look inside do.request.attributes.
>
> This bug had no effect as all global policies we generate (fou)
> seem to be full, anyway, and we treat full and empty the same.
>
> Next patch will change the treatment of empty policies.
>
> Signed-off-by: Jakub Kicinski <kuba@...nel.org>
> ---
> tools/net/ynl/ynl-gen-c.py | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/tools/net/ynl/ynl-gen-c.py b/tools/net/ynl/ynl-gen-c.py
> index e27deb199a70..13d06931c045 100755
> --- a/tools/net/ynl/ynl-gen-c.py
> +++ b/tools/net/ynl/ynl-gen-c.py
> @@ -978,7 +978,9 @@ from lib import SpecFamily, SpecAttrSet, SpecAttr, SpecOperation, SpecEnumSet, S
>
> for op_mode in ['do', 'dump']:
> if op_mode in op:
> - global_set.update(op[op_mode].get('request', []))
> + req = op[op_mode].get('request')
> + if req:
> + global_set.update(req.get('attributes', []))
>
> self.global_policy = []
> self.global_policy_set = attr_set_name
Reviewed-by: Donald Hunter <donald.hunter@...il.com>
Powered by blists - more mailing lists