netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch net-next v2 00/11] devlink: introduce dump selector attr and use it for per-instance dumps
@ 2023-07-20 12:18 Jiri Pirko
  2023-07-20 12:18 ` [patch net-next v2 01/11] devlink: parse linecard attr in doit() callbacks Jiri Pirko
                   ` (12 more replies)
  0 siblings, 13 replies; 35+ messages in thread
From: Jiri Pirko @ 2023-07-20 12:18 UTC (permalink / raw)
  To: netdev; +Cc: kuba, pabeni, davem, edumazet, moshe, saeedm, idosch, petrm

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 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


^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2023-08-02  7:05 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-20 12:18 [patch net-next v2 00/11] devlink: introduce dump selector attr and use it for per-instance dumps Jiri Pirko
2023-07-20 12:18 ` [patch net-next v2 01/11] devlink: parse linecard attr in doit() callbacks Jiri Pirko
2023-07-20 12:18 ` [patch net-next v2 02/11] devlink: parse rate attrs " Jiri Pirko
2023-07-20 12:18 ` [patch net-next v2 03/11] devlink: introduce __devlink_nl_pre_doit() with internal flags as function arg Jiri Pirko
2023-07-20 12:18 ` [patch net-next v2 04/11] devlink: convert port get command to split ops Jiri Pirko
2023-07-20 12:18 ` [patch net-next v2 05/11] devlink: convert health reporter " Jiri Pirko
2023-07-20 12:18 ` [patch net-next v2 06/11] devlink: convert param " Jiri Pirko
2023-07-20 12:18 ` [patch net-next v2 07/11] devlink: convert trap " Jiri Pirko
2023-07-20 12:18 ` [patch net-next v2 08/11] devlink: introduce set of macros and use it for split ops definitions Jiri Pirko
2023-07-25 17:38   ` Jakub Kicinski
2023-07-31 12:21     ` Jiri Pirko
2023-07-31 16:57       ` Jakub Kicinski
2023-08-01  6:41         ` Jiri Pirko
2023-07-20 12:18 ` [patch net-next v2 09/11] devlink: convert rest of the iterator dumpit commands to split ops Jiri Pirko
2023-07-20 12:18 ` [patch net-next v2 10/11] devlink: introduce dump selector attr and use it for per-instance dumps Jiri Pirko
2023-07-25 18:40   ` Jakub Kicinski
2023-07-31 12:47     ` Jiri Pirko
2023-07-31 17:03       ` Jakub Kicinski
2023-08-01  6:42         ` Jiri Pirko
2023-08-01 15:53           ` Jakub Kicinski
2023-08-02  7:02             ` Jiri Pirko
2023-07-20 12:18 ` [patch net-next v2 11/11] devlink: extend health reporter dump selector by port index Jiri Pirko
2023-07-25 18:48   ` Jakub Kicinski
2023-07-31 12:52     ` Jiri Pirko
2023-07-31 17:06       ` Jakub Kicinski
2023-08-01  6:49         ` Jiri Pirko
2023-08-01 15:56           ` Jakub Kicinski
2023-08-02  7:04             ` Jiri Pirko
2023-07-20 13:55 ` [patch net-next v2 00/11] devlink: introduce dump selector attr and use it for per-instance dumps Petr Machata
2023-07-20 14:27   ` Jiri Pirko
2023-07-20 14:51     ` Petr Machata
2023-07-25  8:07 ` Jiri Pirko
2023-07-25  8:36   ` Paolo Abeni
2023-07-25 15:29     ` Jiri Pirko
2023-07-25 16:39       ` Paolo Abeni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).