mbox series

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

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

Message

Jiri Pirko Aug. 11, 2023, 3:57 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.

---
v3->v4:
- fixed NLM_F_DUMP_FILTERED flag handling
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                     |   40 +-
 net/devlink/leftover.c                   |  419 ++--
 net/devlink/netlink.c                    |  110 +-
 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, 5327 insertions(+), 506 deletions(-)

Comments

Jakub Kicinski Aug. 12, 2023, 1:02 a.m. UTC | #1
On Fri, 11 Aug 2023 17:57:01 +0200 Jiri Pirko wrote:
> 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.

Acked-by: Jakub Kicinski <kuba@kernel.org>
patchwork-bot+netdevbpf@kernel.org Aug. 14, 2023, 6:50 p.m. UTC | #2
Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Fri, 11 Aug 2023 17:57:01 +0200 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - [net-next,v4,01/13] devlink: parse linecard attr in doit() callbacks
    https://git.kernel.org/netdev/net-next/c/63618463cb94
  - [net-next,v4,02/13] devlink: parse rate attrs in doit() callbacks
    https://git.kernel.org/netdev/net-next/c/41a1d4d1399a
  - [net-next,v4,03/13] devlink: introduce devlink_nl_pre_doit_port*() helper functions
    https://git.kernel.org/netdev/net-next/c/ee6d78ac28c7
  - [net-next,v4,04/13] devlink: rename doit callbacks for per-instance dump commands
    https://git.kernel.org/netdev/net-next/c/8fa995ad1f7f
  - [net-next,v4,05/13] devlink: introduce dumpit callbacks for split ops
    https://git.kernel.org/netdev/net-next/c/24c8e56d4f98
  - [net-next,v4,06/13] devlink: pass flags as an arg of dump_one() callback
    https://git.kernel.org/netdev/net-next/c/7d3c6fec6135
  - [net-next,v4,07/13] netlink: specs: devlink: add commands that do per-instance dump
    https://git.kernel.org/netdev/net-next/c/7199c86247e9
  - [net-next,v4,08/13] devlink: remove duplicate temporary netlink callback prototypes
    https://git.kernel.org/netdev/net-next/c/ddff283280ba
  - [net-next,v4,09/13] devlink: remove converted commands from small ops
    https://git.kernel.org/netdev/net-next/c/833e479d330c
  - [net-next,v4,10/13] devlink: allow user to narrow per-instance dumps by passing handle attrs
    https://git.kernel.org/netdev/net-next/c/4a1b5aa8b5c7
  - [net-next,v4,11/13] netlink: specs: devlink: extend per-instance dump commands to accept instance attributes
    https://git.kernel.org/netdev/net-next/c/34493336e7d3
  - [net-next,v4,12/13] devlink: extend health reporter dump selector by port index
    https://git.kernel.org/netdev/net-next/c/b03f13cb67a5
  - [net-next,v4,13/13] netlink: specs: devlink: extend health reporter dump attributes by port index
    https://git.kernel.org/netdev/net-next/c/0149bca17262

You are awesome, thank you!