Subject: Re: [PATCH net-next v2 00/11] tools/net/ynl: Add 'sub-message' support to ynl

From: Jakub Kicinski <[email-masked]>
Date: Mon, 11 Dec 2023 15:32:09 -0800

On Mon, 11 Dec 2023 16:40:28 +0000 Donald Hunter wrote:
> This patchset adds a 'sub-message' attribute type to the netlink-raw
> schema and implements it in ynl. This provides support for kind-specific
> options attributes as used in rt_link and tc raw netlink families.
> 
> A description of the new 'sub-message' attribute type and the
> corresponding sub-message definitions is provided in patch 5.
> 
> The patchset includes updates to the rt_link spec and a new tc spec that
> make use of the new 'sub-message' attribute type.
> 
> As mentioned in patch 7, encode support is not yet implemented in ynl
> and support for sub-message selectors at a different nest level from the
> key attribute is not yet supported. I plan to work on these in folloup
> patches.

Seems to break C codegen:

Traceback (most recent call last):
  File "net-next/tools/net/ynl/ynl-gen-c.py", line 2802, in <module>
    main()
  File "net-next/tools/net/ynl/ynl-gen-c.py", line 2531, in main
    parsed = Family(args.spec, exclude_ops)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "net-next/tools/net/ynl/ynl-gen-c.py", line 889, in __init__
    super().__init__(file_name, exclude_ops=exclude_ops)
  File "net-next/tools/net/ynl/lib/nlspec.py", line 481, in __init__
    raise last_exception
  File "net-next/tools/net/ynl/lib/nlspec.py", line 472, in __init__
    elem.resolve()
  File "net-next/tools/net/ynl/ynl-gen-c.py", line 907, in resolve
    self.resolve_up(super())
  File "net-next/tools/net/ynl/lib/nlspec.py", line 53, in resolve_up
    up.resolve()
  File "net-next/tools/net/ynl/lib/nlspec.py", line 583, in resolve
    for elem in self.yaml['sub-messages']:
                ~~~~~~~~~^^^^^^^^^^^^^^^^