Skip to content

ethtool: allow dumping policies to user space

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 Latest7 patches 14 repliesIn review
  2. v16 patches 27 repliesSuperseded

Changes in v2 from the cover letter

- merge patches 1 & 2 -> 1
- add patch 3 & 5
- remove .max_attr from struct ethnl_request_ops

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7ethtool: wire up get policies to opsnet/ethtool/channels.c net/ethtool/coalesce.c net/ethtool/debug.c +14 more+90 -1070 replies
2/7ethtool: wire up set policies to opsnet/ethtool/cabletest.c net/ethtool/channels.c net/ethtool/coalesce.c +11 more+74 -1040 replies
3/7ethtool: trim policy tablesnet/ethtool/bitset.c net/ethtool/cabletest.c net/ethtool/channels.c +16 more+83 -2294 replies
4/7ethtool: link up ethnl_header_policy as a nested policynet/ethtool/cabletest.c net/ethtool/channels.c net/ethtool/coalesce.c +15 more+58 -290 replies
5/7netlink: create helpers for checking type is an intinclude/net/netlink.h+9 -80 replies
6/7netlink: add mask validationinclude/net/netlink.h include/uapi/linux/netlink.h lib/nlattr.c +1 more+56 -00 replies
7/7ethtool: specify which header flags are supported per commandnet/ethtool/netlink.c net/ethtool/netlink.h net/ethtool/pause.c+21 -110 replies

Reviews trailers per patch

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

PatchJohannes Berg
SeriesR-b
1/7
2/7
3/7
4/7
5/7
6/7
7/7

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 0/7] ethtool: allow dumping policies to user space

Hi!

This series wires up ethtool policies to ops, so they can be dumped to user space for feature discovery.

First patch wires up GET commands, and second patch wires up SETs.

The policy tables are trimmed to save space and LoC.

Next - take care of linking up nested policies for the header (which is the policy what we actually care about). And once header policy is linked make sure that attribute range validation for flags is done by policy, not a conditions in the code. New type of policy is needed to validate masks (patch 6).

Netlink as always staying a step ahead of all the other kernel API interfaces :)

v2:
- merge patches 1 & 2 -> 1
- add patch 3 & 5
- remove .max_attr from struct ethnl_request_ops

Jakub Kicinski (7):
ethtool: wire up get policies to ops
ethtool: wire up set policies to ops
ethtool: trim policy tables
ethtool: link up ethnl_header_policy as a nested policy
netlink: create helpers for checking type is an int
netlink: add mask validation
ethtool: specify which header flags are supported per command

 include/net/netlink.h        |  27 +++++---
 include/uapi/linux/netlink.h |   2 +
 lib/nlattr.c                 |  36 ++++++++++
 net/ethtool/bitset.c         |  26 ++++----
 net/ethtool/cabletest.c      |  41 ++++--------
 net/ethtool/channels.c       |  35 ++--------
 net/ethtool/coalesce.c       |  45 ++-----------
 net/ethtool/debug.c          |  24 ++-----
 net/ethtool/eee.c            |  32 +++------
 net/ethtool/features.c       |  30 ++-------
 net/ethtool/linkinfo.c       |  30 ++-------
 net/ethtool/linkmodes.c      |  32 ++-------
 net/ethtool/linkstate.c      |  14 +---
 net/ethtool/netlink.c        | 124 +++++++++++++++++++++++++----------
 net/ethtool/netlink.h        |  35 ++++++++--
 net/ethtool/pause.c          |  27 ++------
 net/ethtool/privflags.c      |  24 ++-----
 net/ethtool/rings.c          |  35 ++--------
 net/ethtool/strset.c         |  25 +++----
 net/ethtool/tsinfo.c         |  13 +---
 net/ethtool/tunnels.c        |  42 ++++--------
 net/ethtool/wol.c            |  24 ++-----
 net/netlink/policy.c         |   8 +++
 23 files changed, 317 insertions(+), 414 deletions(-)
Signature · 1 line
2.26.2