summaryrefslogtreecommitdiff
path: root/tools/net/ynl
diff options
context:
space:
mode:
authorJiri Pirko <jiri@nvidia.com>2023-08-03 13:13:30 +0200
committerJakub Kicinski <kuba@kernel.org>2023-08-04 14:03:01 -0700
commitdc7b81a828db0d9801e7977edff2735d660937a8 (patch)
tree033bd0ddbefd3f87bc62185799f03b5e278f76a7 /tools/net/ynl
parent78c96d7b7c9a6aa41d109ca9b040c3955db90c88 (diff)
ynl-gen-c.py: filter rendering of validate field values for split ops
For split ops, do and dump has different meaningful values in validate field. Fix the rendering to allow the values per op type as follows: do: strict dump: dump, strict-dump Signed-off-by: Jiri Pirko <jiri@nvidia.com> Reviewed-by: Jakub Kicinski <kuba@kernel.org> Link: https://lore.kernel.org/r/20230803111340.1074067-3-jiri@resnulli.us Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/net/ynl')
-rwxr-xr-xtools/net/ynl/ynl-gen-c.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/net/ynl/ynl-gen-c.py b/tools/net/ynl/ynl-gen-c.py
index 650be9b8b693..a3f70ca929fb 100755
--- a/tools/net/ynl/ynl-gen-c.py
+++ b/tools/net/ynl/ynl-gen-c.py
@@ -1988,9 +1988,17 @@ def print_kernel_op_table(family, cw):
cw.block_start()
members = [('cmd', op.enum_name)]
if 'dont-validate' in op:
+ dont_validate = []
+ for x in op['dont-validate']:
+ if op_mode == 'do' and x in ['dump', 'dump-strict']:
+ continue
+ if op_mode == "dump" and x == 'strict':
+ continue
+ dont_validate.append(x)
+
members.append(('validate',
' | '.join([c_upper('genl-dont-validate-' + x)
- for x in op['dont-validate']])), )
+ for x in dont_validate])), )
name = c_lower(f"{family.name}-nl-{op_name}-{op_mode}it")
if 'pre' in op[op_mode]:
members.append((cb_names[op_mode]['pre'], c_lower(op[op_mode]['pre'])))