Skip to content

tools: ynl: generate code for the ethtool family

Jakub Kicinski netdev 1 version Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest12 patches 1 replyApplied 12/12

Patches in v1 All 12 applied

#Subject and filesSizeRepliesApplied
1/12tools: ynl-gen: support excluding tricky opstools/net/ynl/lib/nlspec.py tools/net/ynl/ynl-gen-c.py+17 -50 repliesApplied
2/12tools: ynl-gen: record extra args for regentools/net/ynl/ynl-gen-c.py tools/net/ynl/ynl-regen.sh+8 -10 repliesApplied
3/12netlink: specs: support setting prefix-name per attributeDocumentation/netlink/genetlink-c.yaml Documentation/netlink/genetlink-legacy.yaml tools/net/ynl/ynl-gen-c.py+13 -20 repliesApplied
4/12netlink: specs: ethtool: add C render hintsDocumentation/netlink/specs/ethtool.yaml+5 -00 repliesApplied
5/12tools: ynl-gen: don't generate enum types if unnamedtools/net/ynl/ynl-gen-c.py+10 -20 repliesApplied
6/12tools: ynl-gen: resolve enum vs struct name conflictstools/net/ynl/ynl-gen-c.py+20 -50 repliesApplied
7/12netlink: specs: ethtool: add empty enum stringsetDocumentation/netlink/specs/ethtool.yaml+4 -00 repliesApplied
8/12netlink: specs: ethtool: untangle UDP tunnels and cable test a bitDocumentation/netlink/specs/ethtool.yaml+62 -200 repliesApplied
9/12netlink: specs: ethtool: untangle stats-getDocumentation/netlink/specs/ethtool.yaml+17 -40 repliesApplied
10/12netlink: specs: ethtool: mark pads as padsDocumentation/netlink/specs/ethtool.yaml+4 -40 repliesApplied
11/12tools: ynl: generate code for the ethtool familytools/net/ynl/generated/Makefile tools/net/ynl/generated/ethtool-user.c tools/net/ynl/generated/ethtool-user.h+11890 -30 repliesApplied
12/12tools: ynl: add sample for ethtooltools/net/ynl/samples/.gitignore tools/net/ynl/samples/ethtool.c+66 -00 repliesApplied

Reviews trailers per patch

None of the 12 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchStanislav Fomichev
SeriesA-b
1/12
2/12
3/12
4/12
5/12
6/12
7/12
8/12
9/12
10/12
11/12
12/12

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH net-next 00/12] tools: ynl: generate code for the ethtool family

And finally ethtool support. Thanks to Stan's work the ethtool family spec is quite complete, so there is a lot of operations to support.

I chickened out of stats-get support, they require at the very least type-value support on a u64 scalar. Type-value is an arrangement where a u16 attribute is encoded directly in attribute type. Code gen can support this if the inside is a nest, we just throw in an extra field into that nest to carry the attr type. But a little more coding is needed to for a scalar, because first we need to turn the scalar into a struct with one member, then we can add the attr type.

Other than that ethtool required event support (notification which does not share contents with any GET), but the previous series already added that to the codegen.

I haven't tested all the ops here, and a few I tried seem to work.

Jakub Kicinski (12):
tools: ynl-gen: support excluding tricky ops
tools: ynl-gen: record extra args for regen
netlink: specs: support setting prefix-name per attribute
netlink: specs: ethtool: add C render hints
tools: ynl-gen: don't generate enum types if unnamed
tools: ynl-gen: resolve enum vs struct name conflicts
netlink: specs: ethtool: add empty enum stringset
netlink: specs: ethtool: untangle UDP tunnels and cable test a bit
netlink: specs: ethtool: untangle stats-get
netlink: specs: ethtool: mark pads as pads
tools: ynl: generate code for the ethtool family
tools: ynl: add sample for ethtool

 Documentation/netlink/genetlink-c.yaml      |    4 +
 Documentation/netlink/genetlink-legacy.yaml |    4 +
 Documentation/netlink/specs/ethtool.yaml    |  120 +-
 tools/net/ynl/generated/Makefile            |    9 +-
 tools/net/ynl/generated/ethtool-user.c      | 6353 +++++++++++++++++++
 tools/net/ynl/generated/ethtool-user.h      | 5531 ++++++++++++++++
 tools/net/ynl/lib/nlspec.py                 |   12 +-
 tools/net/ynl/samples/.gitignore            |    1 +
 tools/net/ynl/samples/ethtool.c             |   65 +
 tools/net/ynl/ynl-gen-c.py                  |   59 +-
 tools/net/ynl/ynl-regen.sh                  |    4 +-
 11 files changed, 12116 insertions(+), 46 deletions(-)
 create mode 100644 tools/net/ynl/generated/ethtool-user.c
 create mode 100644 tools/net/ynl/generated/ethtool-user.h
 create mode 100644 tools/net/ynl/samples/ethtool.c
Signature · 1 line
2.40.1