public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next V5 00/12] devlink: add per-port resource support
@ 2026-04-07 19:40 Tariq Toukan
  2026-04-07 19:40 ` [PATCH net-next V5 01/12] devlink: Refactor resource functions to be generic Tariq Toukan
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: Tariq Toukan @ 2026-04-07 19:40 UTC (permalink / raw)
  To: Eric Dumazet, Jakub Kicinski, Paolo Abeni, Andrew Lunn,
	David S. Miller
  Cc: Simon Horman, Donald Hunter, Jiri Pirko, Jonathan Corbet,
	Shuah Khan, Saeed Mahameed, Leon Romanovsky, Tariq Toukan,
	Mark Bloch, Shuah Khan, Matthieu Baerts (NGI0), Chuck Lever,
	Carolina Jubran, Or Har-Toov, Moshe Shemesh, Dragos Tatulea,
	Daniel Zahka, Shahar Shitrit, Cosmin Ratiu, Jacob Keller,
	Parav Pandit, Adithya Jayachandran, Shay Drori, Kees Cook,
	Daniel Jurgens, netdev, linux-kernel, linux-doc, linux-rdma,
	linux-kselftest, Gal Pressman

Hi,

This series by Or 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  refactors resource functions to be generic
Patch #2  adds port-level resource registration infrastructure
Patch #3  registers SF resource on PF port representor in mlx5
Patch #4  adds devlink port resource registration to netdevsim for testing
Patch #5  adds dump support for device-level resources
Patch #6  includes port resources in the resource dump dumpit path
Patch #7  adds port-specific option to resource dump doit path
Patch #8  adds selftest for devlink port resource doit
Patch #9  documents port-level resources and full dump
Patch #10 adds resource scope filtering to resource dump
Patch #11 adds selftest for resource dump and scope filter
Patch #12 documents resource scope filtering

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

V5:
- Link to V4:
  https://lore.kernel.org/all/20260401184947.135205-1-tariqt@nvidia.com/
- Change resource scope attribute from bitmask to u32
- Remove max value and valid mask define for scope attribute
- Handle the case where a device is unregistered or a port is removed
  in the middle of a multi-callback dump (Sashiko's comment)
- Replace port_number with port_index and add an index_valid bool to
  the dump state to track the port resources phase of the dump
  (Sashiko's comment)

Or Har-Toov (12):
  devlink: Refactor resource functions to be generic
  devlink: Add port-level resource registration infrastructure
  net/mlx5: Register SF resource on PF port representor
  netdevsim: Add devlink port resource registration
  devlink: Add dump support for device-level resources
  devlink: Include port resources in resource dump dumpit
  devlink: Add port-specific option to resource dump doit
  selftest: netdevsim: Add devlink port resource doit test
  devlink: Document port-level resources and full dump
  devlink: Add resource scope filtering to resource dump
  selftest: netdevsim: Add resource dump and scope filter test
  devlink: Document resource scope filtering

 Documentation/netlink/specs/devlink.yaml      |  32 +-
 .../networking/devlink/devlink-resource.rst   |  70 ++++
 .../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                  |  11 +
 net/devlink/devl_internal.h                   |   5 +
 net/devlink/netlink.c                         |   2 +
 net/devlink/netlink_gen.c                     |  24 +-
 net/devlink/netlink_gen.h                     |   8 +-
 net/devlink/port.c                            |   2 +
 net/devlink/resource.c                        | 314 +++++++++++++++---
 .../drivers/net/netdevsim/devlink.sh          |  79 ++++-
 15 files changed, 568 insertions(+), 57 deletions(-)


base-commit: c149d90e260ca1b6b9175468955a15c4d95a9f3b
-- 
2.44.0


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

end of thread, other threads:[~2026-04-07 19:43 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-07 19:40 [PATCH net-next V5 00/12] devlink: add per-port resource support Tariq Toukan
2026-04-07 19:40 ` [PATCH net-next V5 01/12] devlink: Refactor resource functions to be generic Tariq Toukan
2026-04-07 19:40 ` [PATCH net-next V5 02/12] devlink: Add port-level resource registration infrastructure Tariq Toukan
2026-04-07 19:40 ` [PATCH net-next V5 03/12] net/mlx5: Register SF resource on PF port representor Tariq Toukan
2026-04-07 19:40 ` [PATCH net-next V5 04/12] netdevsim: Add devlink port resource registration Tariq Toukan
2026-04-07 19:41 ` [PATCH net-next V5 05/12] devlink: Add dump support for device-level resources Tariq Toukan
2026-04-07 19:41 ` [PATCH net-next V5 06/12] devlink: Include port resources in resource dump dumpit Tariq Toukan
2026-04-07 19:41 ` [PATCH net-next V5 07/12] devlink: Add port-specific option to resource dump doit Tariq Toukan
2026-04-07 19:41 ` [PATCH net-next V5 08/12] selftest: netdevsim: Add devlink port resource doit test Tariq Toukan
2026-04-07 19:41 ` [PATCH net-next V5 09/12] devlink: Document port-level resources and full dump Tariq Toukan
2026-04-07 19:41 ` [PATCH net-next V5 10/12] devlink: Add resource scope filtering to resource dump Tariq Toukan
2026-04-07 19:41 ` [PATCH net-next V5 11/12] selftest: netdevsim: Add resource dump and scope filter test Tariq Toukan
2026-04-07 19:41 ` [PATCH net-next V5 12/12] devlink: Document resource scope filtering Tariq Toukan

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