[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230720121829.566974-1-jiri@resnulli.us>
Date: Thu, 20 Jul 2023 14:18:18 +0200
From: Jiri Pirko <jiri@...nulli.us>
To: netdev@...r.kernel.org
Cc: kuba@...nel.org,
pabeni@...hat.com,
davem@...emloft.net,
edumazet@...gle.com,
moshe@...dia.com,
saeedm@...dia.com,
idosch@...dia.com,
petrm@...dia.com
Subject: [patch net-next v2 00/11] devlink: introduce dump selector attr and use it for per-instance dumps
From: Jiri Pirko <jiri@...dia.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 alongside the dump command
and dump only objects which are under selected devlink instance.
Introduce new attr DEVLINK_ATTR_DUMP_SELECTOR to nest the selection
attributes. This way the userspace can use maxattr to tell if dump
selector is supported by kernel or not.
Assemble netlink policy for selector attribute. If user passes attr
unknown to kernel, netlink validation errors out.
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
This is done in patch #10
Dependency:
The DEVLINK_ATTR_DUMP_SELECTOR parsing is very suitable to be done
once at the beginning of the dumping. Unfortunatelly, it is not possible
to define start() and done() callbacks for netlink small ops.
So all commands that use instance iterator for dumpit are converted to
split ops. This is done in patch #1-9
Extension:
patch #11 extends the selector by port index for health reporter
dumping.
v1->v2:
- the original single patch (patch #10) was extended to a patchset
Jiri Pirko (11):
devlink: parse linecard attr in doit() callbacks
devlink: parse rate attrs in doit() callbacks
devlink: introduce __devlink_nl_pre_doit() with internal flags as
function arg
devlink: convert port get command to split ops
devlink: convert health reporter get command to split ops
devlink: convert param get command to split ops
devlink: convert trap get command to split ops
devlink: introduce set of macros and use it for split ops definitions
devlink: convert rest of the iterator dumpit commands to split ops
devlink: introduce dump selector attr and use it for per-instance
dumps
devlink: extend health reporter dump selector by port index
include/uapi/linux/devlink.h | 2 +
net/devlink/devl_internal.h | 42 +++---
net/devlink/health.c | 21 ++-
net/devlink/leftover.c | 211 ++++++++--------------------
net/devlink/netlink.c | 263 ++++++++++++++++++++++++++++++-----
5 files changed, 333 insertions(+), 206 deletions(-)
--
2.41.0
Powered by blists - more mailing lists