public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next V3 00/10] devlink: add per-port resource support
@ 2026-02-26 22:19 Tariq Toukan
  2026-02-26 22:19 ` [PATCH net-next V3 01/10] devlink: Add dump support for device-level resources Tariq Toukan
                   ` (10 more replies)
  0 siblings, 11 replies; 29+ messages in thread
From: Tariq Toukan @ 2026-02-26 22:19 UTC (permalink / raw)
  To: Eric Dumazet, Jakub Kicinski, Paolo Abeni, Andrew Lunn,
	David S. Miller
  Cc: Donald Hunter, Jiri Pirko, Jonathan Corbet, Saeed Mahameed,
	Leon Romanovsky, Tariq Toukan, Mark Bloch, Shuah Khan, netdev,
	linux-kernel, linux-doc, linux-rdma, linux-kselftest,
	Gal Pressman, Dragos Tatulea, Shay Drory, Jiri Pirko,
	Moshe Shemesh

Hi,

This series adds devlink per-port resource support.
See detailed description by Or below [1].

Regards,
Tariq

[1]
Currently, devlink resources are only available at the device level.
However, some resources are inherently per-port, such as the maximum
number of subfunctions (SFs) that can be created on a specific PF port.
This limitation prevents user space from obtaining accurate per-port
capacity information.
This series adds infrastructure for per-port resources in devlink core
and implements it in the mlx5 driver to expose the max_SFs resource
on PF devlink ports.

Patch #1  adds dump support for device-level resources
Patch #2  adds selftest for resource dump
Patch #3  adds dump to resource documentation
Patch #4  refactors resource functions to be generic
Patch #5  adds port-level resource registration infrastructure
Patch #6  adds port resource netlink command
Patch #7  registers SF resource on PF port representor in mlx5
Patch #8  adds devlink port resource registration to netdevsim for testing
Patch #9  adds selftest for devlink port resources
Patch #10 documents port-level resources

With this series, users can query per-port resources:

$ devlink port resource show pci/0000:03:00.0/196608
pci/0000:03:00.0/196608:
  name max_SFs size 20 unit entry

$ devlink port resource show
pci/0000:03:00.0/196608:
  name max_SFs size 20 unit entry
pci/0000:03:00.1/262144:
  name max_SFs size 20 unit entry

Userspace patches for iproute2:
https://github.com/ohartoov/iproute2/tree/port_resource

V3:
- Add dump command for device-level resources.
- Fix selftest to expect the "test_resource" registered by netdevsim
  instead of max_SFs.
- Use a single netlink fill function for both device-level and
  port-level resources.
- Fix documentation to refer to the GET command (kernel/netlink
  perspective) instead of show.
- Link to V2: https://lore.kernel.org/all/20260205142833.1727929-1-tariqt@nvidia.com/


Or Har-Toov (10):
  devlink: Add dump support for device-level resources
  selftest: netdevsim: Add resource dump test
  devlink: Add dump to resource documentation
  devlink: Refactor resource functions to be generic
  devlink: Add port-level resource registration infrastructure
  devlink: Add port resource netlink command
  net/mlx5: Register SF resource on PF port representor
  netdevsim: Add devlink port resource registration
  selftest: netdevsim: Add devlink port resource test
  devlink: Document port-level resources

 Documentation/netlink/specs/devlink.yaml      |  29 +-
 .../networking/devlink/devlink-resource.rst   |  60 ++-
 .../net/ethernet/mellanox/mlx5/core/devlink.h |   4 +
 .../mellanox/mlx5/core/esw/devlink_port.c     |  37 ++
 drivers/net/netdevsim/dev.c                   |  23 +-
 drivers/net/netdevsim/netdevsim.h             |   4 +
 include/net/devlink.h                         |  10 +-
 include/uapi/linux/devlink.h                  |   3 +
 net/devlink/devl_internal.h                   |   4 +
 net/devlink/netlink.c                         |   2 +-
 net/devlink/netlink_gen.c                     |  49 ++-
 net/devlink/netlink_gen.h                     |   8 +-
 net/devlink/port.c                            |   3 +
 net/devlink/resource.c                        | 366 +++++++++++++++---
 .../drivers/net/netdevsim/devlink.sh          |  53 ++-
 15 files changed, 581 insertions(+), 74 deletions(-)


base-commit: 90fcb0f3bc5ab67773b35030af68ed8c6bd83e1c
-- 
2.44.0


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

end of thread, other threads:[~2026-03-12 14:36 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-26 22:19 [PATCH net-next V3 00/10] devlink: add per-port resource support Tariq Toukan
2026-02-26 22:19 ` [PATCH net-next V3 01/10] devlink: Add dump support for device-level resources Tariq Toukan
2026-02-26 22:19 ` [PATCH net-next V3 02/10] selftest: netdevsim: Add resource dump test Tariq Toukan
2026-02-26 22:19 ` [PATCH net-next V3 03/10] devlink: Add dump to resource documentation Tariq Toukan
2026-02-26 22:19 ` [PATCH net-next V3 04/10] devlink: Refactor resource functions to be generic Tariq Toukan
2026-02-26 22:19 ` [PATCH net-next V3 05/10] devlink: Add port-level resource registration infrastructure Tariq Toukan
2026-02-26 22:19 ` [PATCH net-next V3 06/10] devlink: Add port resource netlink command Tariq Toukan
2026-02-26 22:19 ` [PATCH net-next V3 07/10] net/mlx5: Register SF resource on PF port representor Tariq Toukan
2026-02-26 22:19 ` [PATCH net-next V3 08/10] netdevsim: Add devlink port resource registration Tariq Toukan
2026-02-26 22:19 ` [PATCH net-next V3 09/10] selftest: netdevsim: Add devlink port resource test Tariq Toukan
2026-02-26 22:19 ` [PATCH net-next V3 10/10] devlink: Document port-level resources Tariq Toukan
2026-03-03  3:14   ` Jakub Kicinski
2026-03-04 10:06     ` Jiri Pirko
2026-03-03  3:26 ` [PATCH net-next V3 00/10] devlink: add per-port resource support Jakub Kicinski
2026-03-04 10:05   ` Jiri Pirko
2026-03-04 10:34     ` Jiri Pirko
2026-03-04 18:15       ` Jakub Kicinski
2026-03-05  7:56         ` Jiri Pirko
2026-03-05 14:37           ` Jakub Kicinski
2026-03-06 12:13             ` Jiri Pirko
2026-03-06 20:03               ` Jakub Kicinski
2026-03-08 16:03                 ` Or Har-Toov
2026-03-09 20:33                   ` Jakub Kicinski
2026-03-11 18:24                     ` Or Har-Toov
2026-03-11 21:51                       ` Jakub Kicinski
2026-03-12  8:34                         ` Jiri Pirko
2026-03-12 14:19                           ` Jakub Kicinski
2026-03-12 14:29                             ` Jiri Pirko
2026-03-12 14:36                               ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox