devlink: introduce notifications filtering
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 · linked by author and title
- v8 Latest9 patches 2 repliesApplied 9/9
- v79 patches 6 repliesSuperseded
- v69 patches 2 repliesSuperseded
Earlier versions · 5
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v5 | 9 patches | 5 replies | Superseded | |
| v4 | 9 patches | 30 replies | Superseded | |
| v3 | 9 patches | 15 replies | Superseded | |
| v2 | 9 patches | 2 replies | Superseded | |
| v1 | 8 patches | 11 replies | Superseded |
Changes in v8 from the cover letter
- small return value change in patch #5
Patches in v8 All 9 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/9 | devlink: use devl_is_registered() helper instead xa_get_mark()net/ net/ net/ | +9 | 0 replies | Applied |
| 2/9 | devlink: introduce __devl_is_registered() helper and use it instead of xa_get_mark()net/ net/ net/ +1 more | +10 | 0 replies | Applied |
| 3/9 | devlink: send notifications only if there are listenersnet/ net/ net/ +6 more | +21 | 0 replies | Applied |
| 4/9 | devlink: introduce a helper for netlink multicast sendnet/ net/ net/ +6 more | +18 | 0 replies | Applied |
| 5/9 | genetlink: introduce per-sock family private storageinclude/ net/ | +154 | 2 replies | Applied |
| 6/9 | netlink: introduce typedef for filter functiondrivers/ include/ include/ +1 more | +8 | 0 replies | Applied |
| 7/9 | genetlink: introduce helpers to do filtered multicastinclude/ include/ | +58 | 0 replies | Applied |
| 8/9 | devlink: add a command to set notification filter and use it for multicastsDocumentation/ include/ net/ +3 more | +169 | 0 replies | Applied |
| 9/9 | devlink: extend multicast filtering by port indexDocumentation/ net/ net/ +3 more | +31 | 0 replies | Applied |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v8 yet.
Cover letter [patch net-next v8 0/9] devlink: introduce notifications filtering
From: Jiri Pirko <[email protected]>
Currently the user listening on a socket for devlink notifications gets always all messages for all existing devlink instances and objects, even if he is interested only in one of those. That may cause unnecessary overhead on setups with thousands of instances present.
User is currently able to narrow down the devlink objects replies to dump commands by specifying select attributes.
Allow similar approach for notifications providing user a new notify-filter-set command to select attributes with values the notification message has to match. In that case, it is delivered to the socket.
Note that the filtering is done per-socket, so multiple users may specify different selection of attributes with values.
This patchset initially introduces support for following attributes:DEVLINK_ATTR_BUS_NAMEDEVLINK_ATTR_DEV_NAMEDEVLINK_ATTR_PORT_INDEX
Patches #1 - #4 are preparations in devlink code, patch #3 is
an optimization done on the way.
Patches #5 - #7 are preparations in netlink and generic netlink code. Patch #8 is the main one in this set implementing of
the notify-filter-set command and the actual per-socket filtering.
Patch #9 extends the infrastructure allowing to filter according
to a port index.
Example:
$ devlink mon port pci/0000:08:00.0/32768
[port,new] pci/0000:08:00.0/32768: type notset flavour pcisf controller 0 pfnum 0 sfnum 107 splittable false
function:
hw_addr 00:00:00:00:00:00 state inactive opstate detached roce enable
[port,new] pci/0000:08:00.0/32768: type eth flavour pcisf controller 0 pfnum 0 sfnum 107 splittable false
function:
hw_addr 00:00:00:00:00:00 state inactive opstate detached roce enable
[port,new] pci/0000:08:00.0/32768: type eth netdev eth3 flavour pcisf controller 0 pfnum 0 sfnum 107 splittable false
function:
hw_addr 00:00:00:00:00:00 state inactive opstate detached roce enable
[port,new] pci/0000:08:00.0/32768: type eth netdev eth3 flavour pcisf controller 0 pfnum 0 sfnum 107 splittable false
function:
hw_addr 00:00:00:00:00:00 state inactive opstate detached roce enable
[port,new] pci/0000:08:00.0/32768: type eth flavour pcisf controller 0 pfnum 0 sfnum 107 splittable false
function:
hw_addr 00:00:00:00:00:00 state inactive opstate detached roce enable
[port,new] pci/0000:08:00.0/32768: type notset flavour pcisf controller 0 pfnum 0 sfnum 107 splittable false
function:
hw_addr 00:00:00:00:00:00 state inactive opstate detached roce enable
[port,del] pci/0000:08:00.0/32768: type notset flavour pcisf controller 0 pfnum 0 sfnum 107 splittable false
function:
hw_addr 00:00:00:00:00:00 state inactive opstate detached roce enable---v7->v8:
- small return value change in patch #5v6->v7:
- bigger changes in patch #5, moves the tracking to the family xarray with sock as index, makes all lot more nicer and fixes the race conditionsv5->v6:
- in patch #5 added family removal handling of privs destruction, couple other things, see the patch changelog for detailsv4->v5:
- converted priv pointer in netlink_sock to genl_sock container, containing xarray pointer
- introduced per-family init/destroy callbacks and priv_size to allocate per-sock private, converted devlink to that
- see patches #5 and #8 for more detailsv3->v4:
- converted from sk_user_data pointer use to nlk(sk)->priv pointer and allow priv to be stored for multiple generic netlink families, see patch #5 for more detailsv2->v3:
- small cosmetical fixes in patch #6v1->v2:
- added patch #6, fixed generated docs
- see individual patches for details
Jiri Pirko (9):
devlink: use devl_is_registered() helper instead xa_get_mark()
devlink: introduce __devl_is_registered() helper and use it instead of
xa_get_mark()
devlink: send notifications only if there are listeners
devlink: introduce a helper for netlink multicast send
genetlink: introduce per-sock family private storage
netlink: introduce typedef for filter function
genetlink: introduce helpers to do filtered multicast
devlink: add a command to set notification filter and use it for
multicasts
devlink: extend multicast filtering by port index
Documentation/netlink/specs/devlink.yaml | 11 ++ drivers/connector/connector.c | 5 +- include/linux/connector.h | 3 +- include/linux/netlink.h | 6 +- include/net/genetlink.h | 46 +++++++- include/net/netlink.h | 31 ++++- include/uapi/linux/devlink.h | 2 + net/devlink/dev.c | 13 +- net/devlink/devl_internal.h | 59 +++++++++- net/devlink/health.c | 10 +- net/devlink/linecard.c | 5 +- net/devlink/netlink.c | 116 ++++++++++++++++++ net/devlink/netlink_gen.c | 16 ++- net/devlink/netlink_gen.h | 4 +- net/devlink/param.c | 5 +- net/devlink/port.c | 8 +- net/devlink/rate.c | 5 +- net/devlink/region.c | 6 +- net/devlink/trap.c | 18 +-- net/netlink/af_netlink.c | 3 +- net/netlink/genetlink.c | 144 ++++++++++++++++++++++- 21 files changed, 463 insertions(+), 53 deletions(-)
Signature · 1 line
2.43.0