Skip to content

tools: ynl: c: basic netlink-raw support

Jakub Kicinski netdev 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest13 patches 5 repliesIn review 10 of 13 applied
  2. v113 patches 31 repliesSuperseded

Changes in v2 from the cover letter

- extend commit messages
- [patch 10] fix typo in member name
- [patch 12] remove unused arg
v1: https://lore.kernel.org/[email protected]

Patches in v2 10 of 13 applied

#Subject and filesSizeRepliesApplied
1/13netlink: specs: rename rtnetlink specs in accordance with family nameDocumentation/netlink/specs/rt-addr.yaml Documentation/netlink/specs/rt-link.yaml Documentation/netlink/specs/rt-neigh.yaml +4 more+3 -33 repliesApplied
2/13netlink: specs: rt-route: specify fixed-header at operations levelDocumentation/netlink/specs/rt-route.yaml+1 -30 repliesApplied
3/13netlink: specs: rt-addr: remove the fixed members from attrsDocumentation/netlink/specs/rt-addr.yaml+3 -170 repliesApplied
4/13netlink: specs: rt-route: remove the fixed members from attrsDocumentation/netlink/specs/rt-route.yaml+1 -140 repliesApplied
5/13netlink: specs: rt-addr: add C naming infoDocumentation/netlink/specs/rt-addr.yaml+4 -00 repliesApplied
6/13netlink: specs: rt-route: add C naming infoDocumentation/netlink/specs/rt-route.yaml+3 -00 repliesApplied
7/13tools: ynl: support creating non-genl socketstools/net/ynl/lib/ynl.c tools/net/ynl/lib/ynl.h tools/net/ynl/pyynl/ynl_gen_c.py+43 -200 replies
8/13tools: ynl-gen: don't consider requests with fixed hdr emptytools/net/ynl/pyynl/ynl_gen_c.py+5 -20 repliesApplied
9/13tools: ynl: don't use genlmsghdr in classic netlinktools/net/ynl/lib/ynl-priv.h tools/net/ynl/lib/ynl.c tools/net/ynl/pyynl/ynl_gen_c.py+22 -80 repliesApplied
10/13tools: ynl-gen: consider dump ops without a do "type-consistent"tools/net/ynl/pyynl/ynl_gen_c.py+9 -50 repliesApplied
11/13tools: ynl-gen: use family c-name in notificationstools/net/ynl/pyynl/ynl_gen_c.py+3 -30 repliesApplied
12/13tools: ynl: generate code for rt-addr and add a sampletools/net/ynl/Makefile.deps tools/net/ynl/generated/Makefile tools/net/ynl/samples/.gitignore +1 more+84 -22 replies
13/13tools: ynl: generate code for rt-route and add a sampletools/net/ynl/Makefile.deps tools/net/ynl/generated/Makefile tools/net/ynl/samples/.gitignore +1 more+83 -10 replies

Reviews trailers per patch

All 13 patches have a Reviewed-by or Acked-by.

PatchJacob KellerDonald Hunter
1/13R-b R-b
2/13R-b R-b
3/13R-b R-b
4/13R-b R-b
5/13R-b R-b
6/13R-b R-b
7/13R-b R-b
8/13R-b
9/13R-b R-b
10/13R-b
11/13R-b R-b
12/13R-b R-b
13/13R-b R-b

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

Read the v2 thread

Cover letter [PATCH net-next v2 00/13] tools: ynl: c: basic netlink-raw support

Basic support for netlink-raw AKA classic netlink in user space C codegen. This series is enough to read routes and addresses from the kernel (see the samples in patches 12 and 13).

Specs need to be slightly adjusted and decorated with the c naming info.

In terms of codegen this series includes just the basic plumbing required to skip genlmsghdr and handle request types which may technically also be legal in genetlink-legacy but are very uncommon there.

Subsequent series will add support for:
- handling CRUD-style notifications
- code gen for array types classic netlink uses
- sub-message support

v2:
- extend commit messages
- [patch 10] fix typo in member name
- [patch 12] remove unused arg
v1: https://lore.kernel.org/[email protected]

Jakub Kicinski (13):
netlink: specs: rename rtnetlink specs in accordance with family name
netlink: specs: rt-route: specify fixed-header at operations level
netlink: specs: rt-addr: remove the fixed members from attrs
netlink: specs: rt-route: remove the fixed members from attrs
netlink: specs: rt-addr: add C naming info
netlink: specs: rt-route: add C naming info
tools: ynl: support creating non-genl sockets
tools: ynl-gen: don't consider requests with fixed hdr empty
tools: ynl: don't use genlmsghdr in classic netlink
tools: ynl-gen: consider dump ops without a do "type-consistent"
tools: ynl-gen: use family c-name in notifications
tools: ynl: generate code for rt-addr and add a sample
tools: ynl: generate code for rt-route and add a sample

 .../specs/{rt_addr.yaml => rt-addr.yaml}      | 24 ++----
 .../specs/{rt_link.yaml => rt-link.yaml}      |  0
 .../specs/{rt_neigh.yaml => rt-neigh.yaml}    |  0
 .../specs/{rt_route.yaml => rt-route.yaml}    | 22 ++---
 .../specs/{rt_rule.yaml => rt-rule.yaml}      |  0
 .../userspace-api/netlink/netlink-raw.rst     |  2 +-
 tools/net/ynl/Makefile.deps                   |  2 +
 tools/net/ynl/generated/Makefile              |  2 +-
 tools/net/ynl/lib/ynl-priv.h                  |  3 +
 tools/net/ynl/lib/ynl.h                       |  3 +
 tools/net/ynl/lib/ynl.c                       | 59 +++++++++-----
 tools/net/ynl/samples/rt-addr.c               | 80 +++++++++++++++++++
 tools/net/ynl/samples/rt-route.c              | 80 +++++++++++++++++++
 tools/net/ynl/pyynl/ynl_gen_c.py              | 55 +++++++++----
 tools/net/ynl/samples/.gitignore              |  4 +-
 tools/testing/selftests/net/lib/py/ynl.py     |  4 +-
 16 files changed, 263 insertions(+), 77 deletions(-)
 rename Documentation/netlink/specs/{rt_addr.yaml => rt-addr.yaml} (89%)
 rename Documentation/netlink/specs/{rt_link.yaml => rt-link.yaml} (100%)
 rename Documentation/netlink/specs/{rt_neigh.yaml => rt-neigh.yaml} (100%)
 rename Documentation/netlink/specs/{rt_route.yaml => rt-route.yaml} (93%)
 rename Documentation/netlink/specs/{rt_rule.yaml => rt-rule.yaml} (100%)
 create mode 100644 tools/net/ynl/samples/rt-addr.c
 create mode 100644 tools/net/ynl/samples/rt-route.c
Signature · 1 line
2.49.0