Subject: Re: [PATCH net-next v4 4/7] tools: ynl: Add fixed-header support to ynl

From: Jakub Kicinski <[email-masked]>
Date: Fri, 24 Mar 2023 20:47:36 -0700

On Fri, 24 Mar 2023 19:18:57 +0000 Donald Hunter wrote:
> diff --git a/Documentation/netlink/genetlink-legacy.yaml b/Documentation/netlink/genetlink-legacy.yaml
> index d50c78b9f42d..3b8984122383 100644
> --- a/Documentation/netlink/genetlink-legacy.yaml
> +++ b/Documentation/netlink/genetlink-legacy.yaml
> @@ -261,6 +261,13 @@ properties:
>        async-enum:
>          description: Name for the enum type with notifications/events.
>          type: string
> +      # Start genetlink-legacy
> +      fixed-header: &fixed-header
> +        description: |
> +          Name of the structure defininig the optional fixed-length protocol header. This header is

Typo in 'defininig', could you also wrap at 80 chars?
Old school kernel style.

> +          placed in a message after the netlink and genetlink headers and before any attributes.
> +        type: string
> +      # End genetlink-legacy

>  class GenlMsg:
> -    def __init__(self, nl_msg):
> +    def __init__(self, nl_msg, fixed_header_members = []):

spaces around = or no spaces? I don't really know myself but I'm used
to having no spaces.

> @@ -540,7 +555,7 @@ class YnlFamily(SpecFamily):
>                          print('Unexpected message: ' + repr(gm))
>                          continue
>  
> -                rsp.append(self._decode(gm.raw_attrs, op.attr_set.name))
> +                rsp.append(self._decode(gm.raw_attrs, op.attr_set.name) | gm.fixed_header_attrs)

nit: also line wrap?