[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250425172144.GT3042781@horms.kernel.org>
Date: Fri, 25 Apr 2025 18:21:44 +0100
From: Simon Horman <horms@...nel.org>
To: Jakub Kicinski <kuba@...nel.org>
Cc: davem@...emloft.net, netdev@...r.kernel.org, edumazet@...gle.com,
pabeni@...hat.com, andrew+netdev@...n.ch, donald.hunter@...il.com,
jacob.e.keller@...el.com, sdf@...ichev.me, jdamato@...tly.com
Subject: Re: [PATCH net-next v2 07/12] tools: ynl-gen: multi-attr: type gen
for string
On Thu, Apr 24, 2025 at 07:43:06PM -0700, Jakub Kicinski wrote:
> Add support for multi attr strings (needed for link alt_names).
> We record the length individual strings in a len member, to do
> the same for multi-attr create a struct ynl_string in ynl.h
> and use it as a layer holding both the string and its length.
> Since strings may be arbitrary length dynamically allocate each
> individual one.
>
> Adjust arg_member and struct member to avoid spacing the double
> pointers to get "type **name;" rather than "type * *name;"
>
> Reviewed-by: Jacob Keller <jacob.e.keller@...el.com>
> Signed-off-by: Jakub Kicinski <kuba@...nel.org>
> ---
> tools/net/ynl/lib/ynl.h | 13 +++++++++++++
> tools/net/ynl/pyynl/ynl_gen_c.py | 29 +++++++++++++++++++++++++----
> 2 files changed, 38 insertions(+), 4 deletions(-)
>
> diff --git a/tools/net/ynl/lib/ynl.h b/tools/net/ynl/lib/ynl.h
> index 59256e258130..0b4acc0d288a 100644
> --- a/tools/net/ynl/lib/ynl.h
> +++ b/tools/net/ynl/lib/ynl.h
> @@ -85,6 +85,19 @@ struct ynl_sock {
> unsigned char raw_buf[];
> };
>
> +/**
> + * struct ynl_string - parsed individual string
> + * @len: length of the string (excluding terminating character)
> + * @str: valud of the string
typo: value
...
Powered by blists - more mailing lists