Commit dc7b81a8 authored by Jiri Pirko's avatar Jiri Pirko Committed by Jakub Kicinski

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: default avatarJiri Pirko <jiri@nvidia.com>
Reviewed-by: default avatarJakub Kicinski <kuba@kernel.org>
Link: https://lore.kernel.org/r/20230803111340.1074067-3-jiri@resnulli.usSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 78c96d7b
...@@ -1988,9 +1988,17 @@ def print_kernel_op_table(family, cw): ...@@ -1988,9 +1988,17 @@ def print_kernel_op_table(family, cw):
cw.block_start() cw.block_start()
members = [('cmd', op.enum_name)] members = [('cmd', op.enum_name)]
if 'dont-validate' in op: 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', members.append(('validate',
' | '.join([c_upper('genl-dont-validate-' + x) ' | '.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") name = c_lower(f"{family.name}-nl-{op_name}-{op_mode}it")
if 'pre' in op[op_mode]: if 'pre' in op[op_mode]:
members.append((cb_names[op_mode]['pre'], c_lower(op[op_mode]['pre']))) members.append((cb_names[op_mode]['pre'], c_lower(op[op_mode]['pre'])))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment