devlink: allow user to narrow per-instance dumps by passing handle attrs
authorJiri Pirko <jiri@nvidia.com>
Fri, 11 Aug 2023 15:57:11 +0000 (17:57 +0200)
committerJakub Kicinski <kuba@kernel.org>
Mon, 14 Aug 2023 18:47:25 +0000 (11:47 -0700)
commit4a1b5aa8b5c7433ad6e0c8b52469980ae94a4398
treeb44c2346ea55d2bbd1aa2418e6837ba47f9a707c
parent833e479d330c29aa4cfd35b8647d5993d5a78643
devlink: allow user to narrow per-instance dumps by passing handle attrs

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.

Allow user to pass devlink handle attributes alongside the dump command
and dump only objects which are under selected devlink instance.

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

Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Acked-by: Jakub Kicinski <kuba@kernel.org>
Link: https://lore.kernel.org/r/20230811155714.1736405-11-jiri@resnulli.us
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/devlink/netlink.c