[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZX1jbgQ3lgQtkF02@Laptop-X1>
Date: Sat, 16 Dec 2023 16:44:30 +0800
From: Hangbin Liu <liuhangbin@...il.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: netdev@...r.kernel.org, Paolo Abeni <pabeni@...hat.com>
Subject: Re: [PATCH net-next 2/3] tools: ynl-gen: support using defines in
checks
On Fri, Dec 15, 2023 at 06:08:24PM -0800, Jakub Kicinski wrote:
> On Fri, 15 Dec 2023 11:50:08 +0800 Hangbin Liu wrote:
> > - pattern: ^[0-9A-Za-z_]+( - 1)?$
> > + pattern: ^[0-9A-Za-z_-]+( - 1)?$
>
> Why the '-' ? Could you add an example of the define you're trying to
> match to the commit message?
For team driver, there is a define like:
#define TEAM_STRING_MAX_LEN 32
So I'd like to define it in yaml like:
definitions:
-
name: string-max-len
type: const
value: 32
And use it in the attribute-sets like
attribute-sets:
-
name: attr-option
name-prefix: team-attr-option-
attributes:
-
name: unspec
type: unused
value: 0
-
name: name
type: string
checks:
len: string-max-len
With this patch it will be converted to
[TEAM_ATTR_OPTION_NAME] = { .type = NLA_STRING, .len = TEAM_STRING_MAX_LEN, }
Thanks
Hangbin
Powered by blists - more mailing lists