Skip to content

devlink: implement dump selector for devlink objects show commands

Jiri Pirko netdev 2 versions – Applied

Status from this message: This series was applied to iproute2/iproute2-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest6 patches 0 repliesApplied
  2. v16 patches 1 replySuperseded

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/6devlink: move DL_OPT_SB into required optionsdevlink/devlink.c+20 -210 replies
2/6devlink: make parsing of handle non-destructive to argvdevlink/devlink.c+26 -200 replies
3/6devlink: implement command line args dry parsingdevlink/devlink.c+18 -00 replies
4/6devlink: return -ENOENT if argument is missingdevlink/devlink.c+4 -40 replies
5/6mnl_utils: introduce a helper to check if dump policy exists for commandinclude/mnl_utils.h lib/mnl_utils.c+120 -20 replies
6/6devlink: implement dump selector for devlink objects show commandsdevlink/devlink.c+164 -1190 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [patch iproute2-next v2 0/6] devlink: implement dump selector for devlink objects show commands

From: Jiri Pirko <[email protected]>

First 5 patches are preparations for the last one.

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.

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

Jiri Pirko (6):
devlink: move DL_OPT_SB into required options
devlink: make parsing of handle non-destructive to argv
devlink: implement command line args dry parsing
devlink: return -ENOENT if argument is missing
mnl_utils: introduce a helper to check if dump policy exists for
command
devlink: implement dump selector for devlink objects show commands

 devlink/devlink.c   | 382 ++++++++++++++++++++++++++------------------
 include/mnl_utils.h |   1 +
 lib/mnl_utils.c     | 121 +++++++++++++-
 3 files changed, 345 insertions(+), 159 deletions(-)
Signature · 1 line
2.41.0