mbox series

[net-next,v3,00/13] devlink: introduce selective dumps

Message ID 20230810131539.1602299-1-jiri@resnulli.us (mailing list archive)
Headers show
Series devlink: introduce selective dumps | expand

Message

Jiri Pirko Aug. 10, 2023, 1:15 p.m. UTC
From: Jiri Pirko <jiri@nvidia.com>

Motivation:

For SFs, one devlink instance per SF is created. There might be
thousands of these on a single host. When a user needs to know port
handle for specific SF, he needs to dump all devlink ports on the host
which does not scale good.

Solution:

Allow user to pass devlink handle (and possibly other attributes)
alongside the dump command and dump only objects which are matching
the selection.

Use split ops to generate policies for dump callbacks acccording to
the attributes used for selection.

The userspace can use ctrl genetlink GET_POLICY command to find out if
the selective dumps are supported by kernel for particular command.

Example:
$ devlink port show
auxiliary/mlx5_core.eth.0/65535: type eth netdev eth2 flavour physical port 0 splittable false
auxiliary/mlx5_core.eth.1/131071: type eth netdev eth3 flavour physical port 1 splittable false

$ devlink port show auxiliary/mlx5_core.eth.0
auxiliary/mlx5_core.eth.0/65535: type eth netdev eth2 flavour physical port 0 splittable false

$ devlink port show auxiliary/mlx5_core.eth.1
auxiliary/mlx5_core.eth.1/131071: type eth netdev eth3 flavour physical port 1 splittable false

Extension:

patches #12 and #13 extends selection attributes by port index
for health reporter dumping.

v2->v3:
- redid the whole thing using generated split ops and removed nested
  selector attribute as suggested by Jakub. More in individual patches.
v1->v2:
- the original single patch (patch #10) was extended to a patchset

Jiri Pirko (13):
  devlink: parse linecard attr in doit() callbacks
  devlink: parse rate attrs in doit() callbacks
  devlink: introduce devlink_nl_pre_doit_port*() helper functions
  devlink: rename doit callbacks for per-instance dump commands
  devlink: introduce dumpit callbacks for split ops
  devlink: pass flags as an arg of dump_one() callback
  netlink: specs: devlink: add commands that do per-instance dump
  devlink: remove duplicate temporary netlink callback prototypes
  devlink: remove converted commands from small ops
  devlink: allow user to narrow per-instance dumps by passing handle
    attrs
  netlink: specs: devlink: extend per-instance dump commands to accept
    instance attributes
  devlink: extend health reporter dump selector by port index
  netlink: specs: devlink: extend health reporter dump attributes by
    port index

 Documentation/netlink/specs/devlink.yaml |  457 +++-
 net/devlink/dev.c                        |   29 +-
 net/devlink/devl_internal.h              |   44 +-
 net/devlink/health.c                     |   39 +-
 net/devlink/leftover.c                   |  419 ++--
 net/devlink/netlink.c                    |  112 +-
 net/devlink/netlink_gen.c                |  424 +++-
 net/devlink/netlink_gen.h                |   52 +-
 tools/net/ynl/generated/devlink-user.c   | 2434 +++++++++++++++++++++-
 tools/net/ynl/generated/devlink-user.h   | 1824 +++++++++++++++-
 10 files changed, 5328 insertions(+), 506 deletions(-)