All of lore.kernel.org
 help / color / mirror / Atom feed
From: Donald Hunter <donald.hunter@gmail.com>
To: Jacob Keller <jacob.e.keller@intel.com>
Cc: <netdev@vger.kernel.org>, "Jakub Kicinski" <kuba@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	"Jonathan Corbet" <corbet@lwn.net>, <linux-doc@vger.kernel.org>,
	Stanislav Fomichev <sdf@google.com>,
	Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>,
	<donald.hunter@redhat.com>
Subject: Re: [PATCH net-next v4 02/12] doc/netlink: Add a schema for netlink-raw families
Date: Wed, 23 Aug 2023 22:19:53 +0100	[thread overview]
Message-ID: <m2edjth2x2.fsf@gmail.com> (raw)
In-Reply-To: <005940db-b7b6-c935-b16f-8106d3970b11@intel.com> (Jacob Keller's message of "Wed, 23 Aug 2023 12:32:49 -0700")

Jacob Keller <jacob.e.keller@intel.com> writes:

> On 8/23/2023 4:41 AM, Donald Hunter wrote:
>> This schema is largely a copy of the genetlink-legacy schema with the
>> following additions:
>> 
>>  - a top-level protonum property, e.g. 0 (for NETLINK_ROUTE)
>>  - add netlink-raw to the list of protocols supported by the schema
>>  - add a value property to mcast-group definitions
>> 
>> This schema is very similar to genetlink-legacy and I considered
>> making the changes there and symlinking to it. On balance I felt that
>> might be problematic for accurate schema validation.
>> 
>
> Ya, I think they have to be distinct to properly validate.
>
>> Signed-off-by: Donald Hunter <donald.hunter@gmail.com>
>> ---
>>  Documentation/netlink/netlink-raw.yaml | 414 +++++++++++++++++++++++++
>>  1 file changed, 414 insertions(+)
>>  create mode 100644 Documentation/netlink/netlink-raw.yaml
>> 
>> diff --git a/Documentation/netlink/netlink-raw.yaml b/Documentation/netlink/netlink-raw.yaml
>> new file mode 100644
>> index 000000000000..ef7bd07eab62
>> --- /dev/null
>> +++ b/Documentation/netlink/netlink-raw.yaml
>> @@ -0,0 +1,414 @@
>> +# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
>> +%YAML 1.2
>> +---
>> +$id: http://kernel.org/schemas/netlink/genetlink-legacy.yaml#
>> +$schema: https://json-schema.org/draft-07/schema
>> +
>> +# Common defines
>> +$defs:
>> +  uint:
>> +    type: integer
>> +    minimum: 0
>> +  len-or-define:
>> +    type: [ string, integer ]
>> +    pattern: ^[0-9A-Za-z_]+( - 1)?$
>> +    minimum: 0
>> +
>> +# Schema for specs
>> +title: Protocol
>> +description: Specification of a genetlink protocol
>
> If this is for netlink-raw, shouldn't this not say genetlink? Same
> elsewhere? or am I misunderstanding something?

It's a good question. The schema definitions are currently strict
supersets of genetlink:

genetlink <= genetlink-c <= genetlink-legacy <= netlink-raw

As you noted below, there's only 2 additions needed for the netlink raw
families, protonum and mcast-group value.

I would be happy to change the description and other references to
genetlink in this spec, but I'd like to hear Jakub's thoughts about
minimal modification vs a more thorough rewording. Perhaps a middle
ground would be to extend the top-level description to say "genetlink or
raw netlink" and qualify that all mention of genetlink also applies to
raw netlink.

Either way, I just noticed that the schema $id does need to be updated.

>> +type: object
>> +required: [ name, doc, attribute-sets, operations ]
>> +additionalProperties: False
>> +properties:
>> +  name:
>> +    description: Name of the genetlink family.
>> +    type: string
>> +  doc:
>> +    type: string
>> +  version:
>> +    description: Generic Netlink family version. Default is 1.
>> +    type: integer
>> +    minimum: 1
>> +  protocol:
>> +    description: Schema compatibility level. Default is "genetlink".
>> +    enum: [ genetlink, genetlink-c, genetlink-legacy, netlink-raw ] # Trim
>> +  # Start netlink-raw
>
> I guess the netlink raw part is only below this? Or does netlink raw
> share more of the generic netlink code than I thought?

Raw netlink is, so far, the same as genetlink-legacy with the addition
of hard-coded protocol ids.

>> +  protonum:
>> +    description: Protocol number to use for netlink-raw
>> +    type: integer
>> +  # End netlink-raw

[...]

>> +            # Start netlink-raw
>> +            value:
>> +              description: Value of the netlink multicast group in the uAPI.
>> +              type: integer
>> +            # End netlink-raw

  reply	other threads:[~2023-08-23 21:26 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-23 11:41 [PATCH net-next v4 00/12] tools/net/ynl: Add support for netlink-raw families Donald Hunter
2023-08-23 11:41 ` [PATCH net-next v4 01/12] doc/netlink: Fix typo in genetlink-* schemas Donald Hunter
2023-08-23 19:29   ` Jacob Keller
2023-08-23 11:41 ` [PATCH net-next v4 02/12] doc/netlink: Add a schema for netlink-raw families Donald Hunter
2023-08-23 19:32   ` Jacob Keller
2023-08-23 21:19     ` Donald Hunter [this message]
2023-08-23 21:43       ` Jacob Keller
2023-08-24  1:45         ` Jakub Kicinski
2023-08-23 11:41 ` [PATCH net-next v4 03/12] doc/netlink: Update genetlink-legacy documentation Donald Hunter
2023-08-23 19:34   ` Jacob Keller
2023-08-23 11:41 ` [PATCH net-next v4 04/12] doc/netlink: Document the netlink-raw schema extensions Donald Hunter
2023-08-23 19:35   ` Jacob Keller
2023-08-23 11:41 ` [PATCH net-next v4 05/12] tools/ynl: Add mcast-group schema parsing to ynl Donald Hunter
2023-08-23 19:35   ` Jacob Keller
2023-08-23 11:41 ` [PATCH net-next v4 06/12] tools/net/ynl: Fix extack parsing with fixed header genlmsg Donald Hunter
2023-08-23 19:36   ` Jacob Keller
2023-08-23 11:41 ` [PATCH net-next v4 07/12] tools/net/ynl: Add support for netlink-raw families Donald Hunter
2023-08-23 19:37   ` Jacob Keller
2023-08-24  1:46   ` Jakub Kicinski
2023-08-23 11:41 ` [PATCH net-next v4 08/12] tools/net/ynl: Implement nlattr array-nest decoding in ynl Donald Hunter
2023-08-23 19:38   ` Jacob Keller
2023-08-23 11:41 ` [PATCH net-next v4 09/12] tools/net/ynl: Add support for create flags Donald Hunter
2023-08-23 19:39   ` Jacob Keller
2023-08-23 11:41 ` [PATCH net-next v4 10/12] doc/netlink: Add spec for rt addr messages Donald Hunter
2023-08-23 19:39   ` Jacob Keller
2023-08-23 11:42 ` [PATCH net-next v4 11/12] doc/netlink: Add spec for rt link messages Donald Hunter
2023-08-23 19:40   ` Jacob Keller
2023-08-23 11:42 ` [PATCH net-next v4 12/12] doc/netlink: Add spec for rt route messages Donald Hunter
2023-08-23 19:41   ` Jacob Keller

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=m2edjth2x2.fsf@gmail.com \
    --to=donald.hunter@gmail.com \
    --cc=arkadiusz.kubalewski@intel.com \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=donald.hunter@redhat.com \
    --cc=edumazet@google.com \
    --cc=jacob.e.keller@intel.com \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sdf@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.