Skip to content

genetlink: support per-command policy dump

Jakub Kicinski netdev 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest9 patches 1 replyIn review
  2. v210 patches 24 repliesSuperseded
  3. v19 patches 7 repliesSuperseded

v2 from the cover letter

- remove the stale comment in taskstats
- split patch 8 -> 8, 9
- now the getfamily policy is also in the op
- make cmd u32

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9genetlink: reorg struct genl_familyinclude/net/genetlink.h+5 -50 replies
2/9genetlink: add small version of opsdrivers/thermal/thermal_netlink.c include/net/genetlink.h net/netlink/genetlink.c+135 -470 replies
3/9genetlink: move to smaller ops wherever possibledrivers/block/nbd.c drivers/net/gtp.c drivers/net/ieee802154/mac802154_hwsim.c +29 more+107 -1020 replies
4/9genetlink: add a structure for dump stateinclude/net/netlink.h net/netlink/genetlink.c net/netlink/policy.c+39 -310 replies
5/9genetlink: use .start callback for dumppolicynet/netlink/genetlink.c+24 -240 replies
6/9genetlink: bring back per op policyinclude/net/genetlink.h net/netlink/genetlink.c+17 -50 replies
7/9taskstats: move specifying netlink policy back to opskernel/taskstats.c+10 -360 replies
8/9genetlink: use parsed attrs in dumppolicynet/netlink/genetlink.c+2 -70 replies
9/9genetlink: switch control commands to per-op policiesnet/netlink/genetlink.c+11 -30 replies

Reviews trailers per patch

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

PatchJohannes Berg
1/9R-b
2/9R-b
3/9R-b
4/9R-b
5/9R-b
6/9R-b
7/9R-b
8/9R-b
9/9R-b

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

Read the v3 thread

Cover letter [PATCH net-next v3 0/9] genetlink: support per-command policy dump

Hi!

The objective of this series is to dump ethtool policies to be able to tell which flags are supported by the kernel. Current release adds ETHTOOL_FLAG_STATS for dumping extra stats, but because of strict checking we need to make sure that the flag is actually supported before setting it in a request.

Ethtool policies are per command, and so far only dumping family policies was supported.

The series adds new set of "light" ops to genl families which don't have all the callbacks, and won't have the policy. Most of families are then moved to these ops. This gives us 4096B in savings on an allyesconfig build (not counting the growth that would have happened when policy is added):

text data bss dec hex

244415581  227958581  78372980  550747142  20d3bc06
244415581  227962677  78372980  550751238  20d3cc06

Next 5 patches deal the dumping per-op policy.

v3:

The actually patch to dump per-op policy was taken out and will come in a series from Johannes, to make sure uAPI is consistent from the start.

For dump-specific policies I think it should be fine to add a new pair of members to the "full" ops, and not overthink it.

v2:
- remove the stale comment in taskstats
- split patch 8 -> 8, 9
- now the getfamily policy is also in the op
- make cmd u32
v1:
- replace remaining uses of "light" with "small"
- fix dump (ops can't be on the stack there)
- coding changes in patch 4
- new patch 7
- don't echo op in responses - to make dump all easier

Dave - this series will cause a very trivial conflict with the patch I sent to net. Both sides add some kdoc to struct genl_ops so we'll need to keep it all. I'm sending this already because I also need to restructure ethool policies in time for 5.10 if we want to use it for the stats flag.

Jakub Kicinski (9):
genetlink: reorg struct genl_family
genetlink: add small version of ops
genetlink: move to smaller ops wherever possible
genetlink: add a structure for dump state
genetlink: use .start callback for dumppolicy
genetlink: bring back per op policy
taskstats: move specifying netlink policy back to ops
genetlink: use parsed attrs in dumppolicy
genetlink: switch control commands to per-op policies

 drivers/block/nbd.c                      |   6 +-
 drivers/net/gtp.c                        |   6 +-
 drivers/net/ieee802154/mac802154_hwsim.c |   6 +-
 drivers/net/macsec.c                     |   6 +-
 drivers/net/team/team.c                  |   6 +-
 drivers/net/wireless/mac80211_hwsim.c    |   6 +-
 drivers/target/target_core_user.c        |   6 +-
 drivers/thermal/thermal_netlink.c        |   8 +-
 fs/dlm/netlink.c                         |   6 +-
 include/net/genetlink.h                  |  67 +++++--
 include/net/netlink.h                    |  11 +-
 kernel/taskstats.c                       |  40 +---
 net/batman-adv/netlink.c                 |   6 +-
 net/core/devlink.c                       |   6 +-
 net/core/drop_monitor.c                  |   6 +-
 net/hsr/hsr_netlink.c                    |   6 +-
 net/ieee802154/netlink.c                 |   6 +-
 net/ipv4/fou.c                           |   6 +-
 net/ipv4/tcp_metrics.c                   |   6 +-
 net/l2tp/l2tp_netlink.c                  |   6 +-
 net/mptcp/pm_netlink.c                   |   6 +-
 net/ncsi/ncsi-netlink.c                  |   6 +-
 net/netfilter/ipvs/ip_vs_ctl.c           |   6 +-
 net/netlabel/netlabel_calipso.c          |   6 +-
 net/netlabel/netlabel_cipso_v4.c         |   6 +-
 net/netlabel/netlabel_mgmt.c             |   6 +-
 net/netlabel/netlabel_unlabeled.c        |   6 +-
 net/netlink/genetlink.c                  | 224 ++++++++++++++++-------
 net/netlink/policy.c                     |  31 ++--
 net/openvswitch/conntrack.c              |   6 +-
 net/openvswitch/datapath.c               |  24 +--
 net/openvswitch/meter.c                  |   6 +-
 net/psample/psample.c                    |   6 +-
 net/tipc/netlink_compat.c                |   6 +-
 net/wimax/stack.c                        |   6 +-
 net/wireless/nl80211.c                   |   5 +
 36 files changed, 334 insertions(+), 244 deletions(-)
Signature · 1 line
2.26.2