mbox series

[net-next,v2,00/11] devlink: use spec to generate split ops

Message ID 20230802152023.941837-1-jiri@resnulli.us (mailing list archive)
Headers show
Series devlink: use spec to generate split ops | expand

Message

Jiri Pirko Aug. 2, 2023, 3:20 p.m. UTC
From: Jiri Pirko <jiri@nvidia.com>

This is an outcome of the discussion in the following thread:
https://lore.kernel.org/netdev/20230720121829.566974-1-jiri@resnulli.us/
It serves as a dependency on the linked selector patchset.

There is an existing spec for devlink used for userspace part
generation. There are two commands supported there.

This patchset extends the spec so kernel split ops code could
be generated from it.

---
v1->v2:
- see individual patches for changelog

Jiri Pirko (11):
  netlink: specs: add dump-strict flag for dont-validate property
  ynl-gen-c.py: filter rendering of validate field values for split ops
  ynl-gen-c.py: allow directional model for kernel mode
  ynl-gen-c.py: render netlink policies static for split ops
  devlink: rename devlink_nl_ops to devlink_nl_small_ops
  netlink: specs: devlink: add info-get dump op
  devlink: add split ops generated according to spec
  devlink: include the generated netlink header
  devlink: rename couple of doit netlink callbacks to match generated
    names
  devlink: introduce couple of dumpit callbacks for split ops
  devlink: use generated split ops and remove duplicated commands from
    small ops

 Documentation/netlink/genetlink-c.yaml      |  2 +-
 Documentation/netlink/genetlink-legacy.yaml |  2 +-
 Documentation/netlink/genetlink.yaml        |  2 +-
 Documentation/netlink/specs/devlink.yaml    | 14 ++++-
 net/devlink/Makefile                        |  2 +-
 net/devlink/dev.c                           | 27 +++++-----
 net/devlink/devl_internal.h                 | 20 +++----
 net/devlink/leftover.c                      | 16 +-----
 net/devlink/netlink.c                       | 35 ++++++------
 net/devlink/netlink_gen.c                   | 59 +++++++++++++++++++++
 net/devlink/netlink_gen.h                   | 29 ++++++++++
 tools/net/ynl/generated/devlink-user.c      | 53 ++++++++++++++++++
 tools/net/ynl/generated/devlink-user.h      | 10 ++++
 tools/net/ynl/ynl-gen-c.py                  | 20 +++++--
 14 files changed, 231 insertions(+), 60 deletions(-)
 create mode 100644 net/devlink/netlink_gen.c
 create mode 100644 net/devlink/netlink_gen.h

Comments

Jakub Kicinski Aug. 3, 2023, 2:07 a.m. UTC | #1
On Wed,  2 Aug 2023 17:20:12 +0200 Jiri Pirko wrote:
> This is an outcome of the discussion in the following thread:
> https://lore.kernel.org/netdev/20230720121829.566974-1-jiri@resnulli.us/
> It serves as a dependency on the linked selector patchset.
> 
> There is an existing spec for devlink used for userspace part
> generation. There are two commands supported there.
> 
> This patchset extends the spec so kernel split ops code could
> be generated from it.

Looks good! But you need to reshuffle stuff in patches 7-10
because there's a temporary build breakage. Some squashing,
reordering and maybe splitting patch 10 should do?

Feel free to post v3 without waiting the full 24h.
Jiri Pirko Aug. 3, 2023, 6:01 a.m. UTC | #2
Thu, Aug 03, 2023 at 04:07:34AM CEST, kuba@kernel.org wrote:
>On Wed,  2 Aug 2023 17:20:12 +0200 Jiri Pirko wrote:
>> This is an outcome of the discussion in the following thread:
>> https://lore.kernel.org/netdev/20230720121829.566974-1-jiri@resnulli.us/
>> It serves as a dependency on the linked selector patchset.
>> 
>> There is an existing spec for devlink used for userspace part
>> generation. There are two commands supported there.
>> 
>> This patchset extends the spec so kernel split ops code could
>> be generated from it.
>
>Looks good! But you need to reshuffle stuff in patches 7-10
>because there's a temporary build breakage. Some squashing,
>reordering and maybe splitting patch 10 should do?

I was very careful not to cause any breakage. Will double check, fix the
2 nits and send v3.

Thanks!

>
>Feel free to post v3 without waiting the full 24h.
>-- 
>pw-bot: cr