Skip to content

devlink: add per-port resource support

Tariq Toukan linux-doc linux-kselftest linux-rdma lkml netdev 5 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest12 patches 1 replyApplied 12/12
  2. v412 patches 2 repliesSuperseded
  3. v310 patches 18 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v27 patches9 repliesSuperseded
v15 patches8 repliesSuperseded

Changes in v5 from the cover letter

- Link to V4:
https://lore.kernel.org/all/[email protected]/
- 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)

Patches in v5 All 12 applied

#Subject and filesSizeRepliesApplied
1/12devlink: Refactor resource functions to be genericinclude/net/devlink.h net/devlink/resource.c+73 -430 repliesApplied
2/12devlink: Add port-level resource registration infrastructureinclude/net/devlink.h net/devlink/port.c net/devlink/resource.c+53 -00 repliesApplied
3/12net/mlx5: Register SF resource on PF port representordrivers/net/ethernet/mellanox/mlx5/core/devlink.h drivers/net/ethernet/mellanox/mlx5/core/esw/devlink_port.c+41 -00 repliesApplied
4/12netdevsim: Add devlink port resource registrationdrivers/net/netdevsim/dev.c drivers/net/netdevsim/netdevsim.h+26 -10 repliesApplied
5/12devlink: Add dump support for device-level resourcesDocumentation/netlink/specs/devlink.yaml net/devlink/netlink_gen.c net/devlink/netlink_gen.h +1 more+102 -50 repliesApplied
6/12devlink: Include port resources in resource dump dumpitnet/devlink/devl_internal.h net/devlink/netlink.c net/devlink/resource.c+58 -80 repliesApplied
7/12devlink: Add port-specific option to resource dump doitDocumentation/netlink/specs/devlink.yaml net/devlink/netlink_gen.c net/devlink/netlink_gen.h +1 more+24 -70 repliesApplied
8/12selftest: netdevsim: Add devlink port resource doit testtools/testing/selftests/drivers/net/netdevsim/devlink.sh+28 -10 repliesApplied
9/12devlink: Document port-level resources and full dumpDocumentation/networking/devlink/devlink-resource.rst+35 -00 repliesApplied
10/12devlink: Add resource scope filtering to resource dumpDocumentation/netlink/specs/devlink.yaml include/uapi/linux/devlink.h net/devlink/netlink_gen.c +1 more+55 -40 repliesApplied
11/12selftest: netdevsim: Add resource dump and scope filter testtools/testing/selftests/drivers/net/netdevsim/devlink.sh+51 -10 repliesApplied
12/12devlink: Document resource scope filteringDocumentation/networking/devlink/devlink-resource.rst+35 -00 repliesApplied

Reviews trailers per patch

All 12 patches have a Reviewed-by or Acked-by.

PatchShay DroriMoshe ShemeshJiri Pirko
1/12R-b R-b R-b
2/12R-b R-b R-b
3/12R-b R-b R-b
4/12R-b R-b R-b
5/12R-b R-b R-b
6/12R-b
7/12R-b
8/12R-b
9/12R-b R-b R-b
10/12R-b
11/12R-b
12/12R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v5 thread

Cover letter [PATCH net-next V5 00/12] devlink: add per-port resource support

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/[email protected]/
- 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

Signature · 1 line
2.44.0