From: Jiri Pirko <jiri@resnulli.us>
To: Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, pabeni@redhat.com, davem@davemloft.net,
edumazet@google.com, donald.hunter@gmail.com
Subject: Re: [patch net-next v2 1/3] tools: ynl-gen: lift type requirement for attribute subsets
Date: Thu, 5 Oct 2023 09:23:26 +0200 [thread overview]
Message-ID: <ZR5kbsUGuRB3dYWD@nanopsycho> (raw)
In-Reply-To: <20231004171202.6e52bde3@kernel.org>
Thu, Oct 05, 2023 at 02:12:02AM CEST, kuba@kernel.org wrote:
>On Fri, 29 Sep 2023 15:47:40 +0200 Jiri Pirko wrote:
>> --- a/tools/net/ynl/ynl-gen-c.py
>> +++ b/tools/net/ynl/ynl-gen-c.py
>> @@ -723,6 +723,8 @@ class AttrSet(SpecAttrSet):
>> self.c_name = ''
>>
>> def new_attr(self, elem, value):
>> + if 'type' not in elem:
>> + raise Exception(f"Type has to be set for attribute {elem['name']}")
>> if elem['type'] in scalars:
>> t = TypeScalar(self.family, self, elem, value)
>> elif elem['type'] == 'unused':
>
>Can this still be enforced using JSON schema? Using dependencies
>to make sure that if subset-of is not present type is?
I have no clue. I know very little about json schema. I can take a look.
next prev parent reply other threads:[~2023-10-05 7:23 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-29 13:47 [patch net-next v2 0/3] tools: ynl-gen: fix subset attributes handling Jiri Pirko
2023-09-29 13:47 ` [patch net-next v2 1/3] tools: ynl-gen: lift type requirement for attribute subsets Jiri Pirko
2023-10-05 0:12 ` Jakub Kicinski
2023-10-05 7:23 ` Jiri Pirko [this message]
2023-09-29 13:47 ` [patch net-next v2 2/3] netlink: specs: remove redundant type keys from attributes in subsets Jiri Pirko
2023-10-05 0:12 ` Jakub Kicinski
2023-09-29 13:47 ` [patch net-next v2 3/3] tools: ynl-gen: raise exception when subset attribute contains more than "name" key Jiri Pirko
2023-10-05 0:13 ` Jakub Kicinski
2023-10-05 7:25 ` Jiri Pirko
2023-10-05 14:21 ` Jakub Kicinski
2023-10-05 14:50 ` Jiri Pirko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZR5kbsUGuRB3dYWD@nanopsycho \
--to=jiri@resnulli.us \
--cc=davem@davemloft.net \
--cc=donald.hunter@gmail.com \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).