netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Donald Hunter <donald.hunter@gmail.com>
To: 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>
Cc: donald.hunter@redhat.com, Donald Hunter <donald.hunter@gmail.com>
Subject: [PATCH net-next v5 00/12] tools/net/ynl: Add support for netlink-raw families
Date: Thu, 24 Aug 2023 12:19:51 +0100	[thread overview]
Message-ID: <20230824112003.52939-1-donald.hunter@gmail.com> (raw)

This patchset adds support for netlink-raw families such as rtnetlink.

Patch 1 fixes a typo in existing schemas
Patch 2 contains the schema definition
Patches 3 & 4 update the schema documentation
Patches 5 - 9 extends ynl
Patches 10 - 12 add several netlink-raw specs

The netlink-raw schema is very similar to genetlink-legacy and I thought
about making the changes there and symlinking to it. On balance I
thought that might be problematic for accurate schema validation.

rtnetlink doesn't seem to fit into unified or directional message
enumeration models. It seems like an 'explicit' model would be useful,
to force the schema author to specify the message ids directly.

There is not yet support for notifications because ynl currently doesn't
support defining 'event' properties on a 'do' operation. The message ids
are shared so ops need to be both sync and async. I plan to look at this
in a future patch.

The link and route messages contain different nested attributes
dependent on the type of link or route. Decoding these will need some
kind of attr-space selection that uses the value of another attribute as
the selector key. These nested attributes have been left with type
'binary' for now.

v4 -> v5:
  - Fix schema id in netlink-raw schema
  - Remove doc references to genetlink from netlink-raw schema
  - Add missing whitespace between classes in ynl.py

v3 -> v4:
  - Fix incorrect var name in handle_ntf
  - Update rt_link spec to include operation attributes
  - Update rt_route spec to refine operation attributes

v2 -> v3:
  - Fix typo in existing schemas
  - Rework fixed_header code to fix extack parsing
  - Add support for CREATE, EXCL, REPLACE and APPEND, needed by rt_route

v1 -> v2:
  - Put mcast-group changes in separate patch
  - Put decode_fixed_header refactoring in separate patch
  - Avoid refactoring decode_enum
  - Rename NetlinkProtocolFamily -> NetlinkProtocol and
    GenlProtocolFamily -> GenlProtocol and store in self.nlproto
  - Add spec for rt link.

Donald Hunter (12):
  doc/netlink: Fix typo in genetlink-* schemas
  doc/netlink: Add a schema for netlink-raw families
  doc/netlink: Update genetlink-legacy documentation
  doc/netlink: Document the netlink-raw schema extensions
  tools/ynl: Add mcast-group schema parsing to ynl
  tools/net/ynl: Fix extack parsing with fixed header genlmsg
  tools/net/ynl: Add support for netlink-raw families
  tools/net/ynl: Implement nlattr array-nest decoding in ynl
  tools/net/ynl: Add support for create flags
  doc/netlink: Add spec for rt addr messages
  doc/netlink: Add spec for rt link messages
  doc/netlink: Add spec for rt route messages

 Documentation/core-api/netlink.rst            |    9 +-
 Documentation/netlink/genetlink-c.yaml        |    2 +-
 Documentation/netlink/genetlink-legacy.yaml   |    2 +-
 Documentation/netlink/netlink-raw.yaml        |  410 +++++
 Documentation/netlink/specs/rt_addr.yaml      |  179 ++
 Documentation/netlink/specs/rt_link.yaml      | 1499 +++++++++++++++++
 Documentation/netlink/specs/rt_route.yaml     |  327 ++++
 .../netlink/genetlink-legacy.rst              |   26 +-
 Documentation/userspace-api/netlink/index.rst |    1 +
 .../userspace-api/netlink/netlink-raw.rst     |   58 +
 Documentation/userspace-api/netlink/specs.rst |   13 +
 tools/net/ynl/cli.py                          |   12 +-
 tools/net/ynl/lib/__init__.py                 |    4 +-
 tools/net/ynl/lib/nlspec.py                   |   31 +
 tools/net/ynl/lib/ynl.py                      |  198 ++-
 15 files changed, 2699 insertions(+), 72 deletions(-)
 create mode 100644 Documentation/netlink/netlink-raw.yaml
 create mode 100644 Documentation/netlink/specs/rt_addr.yaml
 create mode 100644 Documentation/netlink/specs/rt_link.yaml
 create mode 100644 Documentation/netlink/specs/rt_route.yaml
 create mode 100644 Documentation/userspace-api/netlink/netlink-raw.rst

-- 
2.39.2 (Apple Git-143)


             reply	other threads:[~2023-08-24 11:20 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-24 11:19 Donald Hunter [this message]
2023-08-24 11:19 ` [PATCH net-next v5 01/12] doc/netlink: Fix typo in genetlink-* schemas Donald Hunter
2023-08-24 11:19 ` [PATCH net-next v5 02/12] doc/netlink: Add a schema for netlink-raw families Donald Hunter
2023-08-24 21:04   ` Jacob Keller
2023-08-24 11:19 ` [PATCH net-next v5 03/12] doc/netlink: Update genetlink-legacy documentation Donald Hunter
2023-08-24 11:19 ` [PATCH net-next v5 04/12] doc/netlink: Document the netlink-raw schema extensions Donald Hunter
2023-08-24 11:19 ` [PATCH net-next v5 05/12] tools/ynl: Add mcast-group schema parsing to ynl Donald Hunter
2023-08-24 11:19 ` [PATCH net-next v5 06/12] tools/net/ynl: Fix extack parsing with fixed header genlmsg Donald Hunter
2023-08-24 11:19 ` [PATCH net-next v5 07/12] tools/net/ynl: Add support for netlink-raw families Donald Hunter
2023-08-24 11:19 ` [PATCH net-next v5 08/12] tools/net/ynl: Implement nlattr array-nest decoding in ynl Donald Hunter
2023-08-24 11:20 ` [PATCH net-next v5 09/12] tools/net/ynl: Add support for create flags Donald Hunter
2023-08-24 11:20 ` [PATCH net-next v5 10/12] doc/netlink: Add spec for rt addr messages Donald Hunter
2023-08-24 11:20 ` [PATCH net-next v5 11/12] doc/netlink: Add spec for rt link messages Donald Hunter
2023-08-24 16:46   ` Jiri Pirko
2023-08-25  9:04     ` Donald Hunter
2023-08-24 11:20 ` [PATCH net-next v5 12/12] doc/netlink: Add spec for rt route messages Donald Hunter

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=20230824112003.52939-1-donald.hunter@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=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 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).