Skip to content

devlink: add per-port resource support

Tariq Toukan linux-doc linux-kselftest linux-rdma lkml netdev 1 version Applied

Status from this message: applied to iproute2-next with the fixup recommended by Claude and

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 4 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/7devlink: Split dpipe tables output to a separate functiondevlink/devlink.c+31 -230 replies
2/7devlink: Move dpipe tables query to resources show callbackdevlink/devlink.c+62 -200 replies
3/7devlink: fix memory leak in resource_ctx_finidevlink/devlink.c+1 -00 replies
4/7devlink: add dump support for resource showdevlink/devlink.c man/man8/devlink-resource.8+22 -60 replies
5/7devlink: show port resources in resource dumpdevlink/devlink.c+11 -60 replies
6/7devlink: add per-port resource show supportbash-completion/devlink devlink/devlink.c man/man8/devlink-resource.8+20 -30 replies
7/7devlink: add scope filter to resource showbash-completion/devlink devlink/devlink.c man/man8/devlink-resource.8+58 -73 replies

Reviews trailers per patch

2 of 7 patches have a Reviewed-by or Acked-by.

PatchPetr MachataJiri Pirko
1/7R-b R-b
2/7R-b R-b
3/7
4/7
5/7
6/7
7/7

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH iproute2-next 0/7] devlink: add per-port resource support

Hi,

Currently, devlink resource show only supports querying a specific device and displays device-level resources. However, some resources are per-port, such as the maximum number of SFs that can be created on a specific PF port.

This series extends devlink resource show with full support for port-level resources, including a dump mode, per-port querying syntax, and scope filtering. In preparation for these features, the first two patches refactor how dpipe tables are handled to unblock dump support and ensure errors in secondary queries are non-fatal.

The series is organized as follows:

Patch 1 splits the dpipe tables display into a separate function.

Patch 2 moves the dpipe tables query into the per-device resource show callback, ensuring it behaves correctly during a multi-device dump.

Patch 3 fixes a pre-existing memory leak in resource_ctx_fini.

Patch 4 adds dump support to resource show (no device required).

Patch 5 shows port-level resources returned in a dump reply.

Patch 6 adds DEV/PORT_INDEX syntax to resource show.

Patch 7 adds scope filter to resource show.

With this series, users can query resources at all levels:

$ devlink resource show
pci/0000:03:00.0:
  name local_max_SFs size 508 unit entry
  name external_max_SFs size 508 unit entry
pci/0000:03:00.0/196608:
  name max_SFs size 20 unit entry
$ devlink resource show scope dev
pci/0000:03:00.0:
  name local_max_SFs size 508 unit entry
  name external_max_SFs size 508 unit entry
$ devlink resource show scope port
pci/0000:03:00.0/196608:
  name max_SFs size 20 unit entry
$ devlink resource show pci/0000:03:00.0/196608
pci/0000:03:00.0/196608:
  name max_SFs size 20 unit entry

This series is the userspace counterpart to the kernel series:
https://lore.kernel.org/all/[email protected]/

Ido Schimmel (2):
devlink: Split dpipe tables output to a separate function
devlink: Move dpipe tables query to resources show callback

Or Har-Toov (5):
devlink: fix memory leak in resource_ctx_fini
devlink: add dump support for resource show
devlink: show port resources in resource dump
devlink: add per-port resource show support
devlink: add scope filter to resource show

 bash-completion/devlink     |   8 ++
 devlink/devlink.c           | 202 +++++++++++++++++++++++++++---------
 man/man8/devlink-resource.8 |  34 +++++-
 3 files changed, 192 insertions(+), 52 deletions(-)

base-commit: 7340b539841dc739bc0b813e8e86825bc1eb5a4c

Signature · 1 line
2.44.0