| From: |
| Tariq Toukan <tariqt-AT-nvidia.com> |
| To: |
| Eric Dumazet <edumazet-AT-google.com>, Jakub Kicinski <kuba-AT-kernel.org>, Paolo Abeni <pabeni-AT-redhat.com>, Andrew Lunn <andrew+netdev-AT-lunn.ch>, "David S. Miller" <davem-AT-davemloft.net> |
| Subject: |
| [PATCH net-next V4 00/12] devlink: add per-port resource support |
| Date: |
| Wed, 01 Apr 2026 21:49:35 +0300 |
| Message-ID: |
| <20260401184947.135205-1-tariqt@nvidia.com> |
| Cc: |
| Simon Horman <horms-AT-kernel.org>, Donald Hunter <donald.hunter-AT-gmail.com>, Jiri Pirko <jiri-AT-resnulli.us>, Jonathan Corbet <corbet-AT-lwn.net>, Shuah Khan <skhan-AT-linuxfoundation.org>, Saeed Mahameed <saeedm-AT-nvidia.com>, "Leon Romanovsky" <leon-AT-kernel.org>, Tariq Toukan <tariqt-AT-nvidia.com>, Mark Bloch <mbloch-AT-nvidia.com>, Shuah Khan <shuah-AT-kernel.org>, Chuck Lever <chuck.lever-AT-oracle.com>, "Matthieu Baerts (NGI0)" <matttbe-AT-kernel.org>, Carolina Jubran <cjubran-AT-nvidia.com>, Or Har-Toov <ohartoov-AT-nvidia.com>, Moshe Shemesh <moshe-AT-nvidia.com>, Dragos Tatulea <dtatulea-AT-nvidia.com>, Shahar Shitrit <shshitrit-AT-nvidia.com>, Daniel Zahka <daniel.zahka-AT-gmail.com>, Jacob Keller <jacob.e.keller-AT-intel.com>, Cosmin Ratiu <cratiu-AT-nvidia.com>, Parav Pandit <parav-AT-nvidia.com>, Shay Drori <shayd-AT-nvidia.com>, "Adithya Jayachandran" <ajayachandra-AT-nvidia.com>, Kees Cook <kees-AT-kernel.org>, "Daniel Jurgens" <danielj-AT-nvidia.com>, <netdev-AT-vger.kernel.org>, <linux-kernel-AT-vger.kernel.org>, <linux-doc-AT-vger.kernel.org>, <linux-rdma-AT-vger.kernel.org>, <linux-kselftest-AT-vger.kernel.org>, Gal Pressman <gal-AT-nvidia.com> |
| Archive-link: |
| Article |
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
V4:
- Link to V3:
https://lore.kernel.org/all/20260226221916.1800227-1-tari...
- Remove new devlink port resource command
- Add devlink resource show for all resources (devices + ports) via
dumpit
- Add scope parameter to dump (scope dev / scope port)
- Extend the doit command with port handle option while preserving the
legacy dev doit path
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 | 17 +
net/devlink/devl_internal.h | 4 +
net/devlink/netlink_gen.c | 24 +-
net/devlink/netlink_gen.h | 8 +-
net/devlink/port.c | 2 +
net/devlink/resource.c | 319 +++++++++++++++---
.../drivers/net/netdevsim/devlink.sh | 79 ++++-
14 files changed, 576 insertions(+), 57 deletions(-)
base-commit: f1359c240191e686614847905fc861cbda480b47
--
2.44.0