devlink: add per-port resource support
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
Patches in v1 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/7 | devlink: Split dpipe tables output to a separate functiondevlink/ | +31 | 0 replies | |
| 2/7 | devlink: Move dpipe tables query to resources show callbackdevlink/ | +62 | 0 replies | |
| 3/7 | devlink: fix memory leak in resource_ctx_finidevlink/ | +1 | 0 replies | |
| 4/7 | devlink: add dump support for resource showdevlink/ man/ | +22 | 0 replies | |
| 5/7 | devlink: show port resources in resource dumpdevlink/ | +11 | 0 replies | |
| 6/7 | devlink: add per-port resource show supportbash-completion/ devlink/ man/ | +20 | 0 replies | |
| 7/7 | devlink: add scope filter to resource showbash-completion/ devlink/ man/ | +58 | 3 replies |
Reviews trailers per patch
2 of 7 patches have a Reviewed-by or Acked-by.
| Patch | Petr Machata | Jiri Pirko |
|---|---|---|
| 1/7 | R-b | R-b |
| 2/7 | R-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.
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