[PATCH net-next 00/14] devlink, mlx5: Add new parameters for link management and SRIOV/eSwitch configurations

Saeed Mahameed
2025-02-28T02:13:25Z

From: Saeed Mahameed <saeedm@nvidia.com>

This patch series introduces several devlink parameters improving device
configuration capabilities, link management, and SRIOV/eSwitch, by adding
NV config boot time parameters.

Below is a summary of the key changes:

1) Enable support for devlink port parameters

2) Implement multi attribute devlink param value data, for u32 array
type parameters

3) Implement the following parameters:

3.a) total_vfs Parameter:
-------------------------

Adds support for managing the number of VFs (total_vfs) and enabling
SR-IOV (enable_sriov for mlx5) through devlink. These additions enhance
user control over virtualization features directly from standard kernel
interfaces without relying on additional external tools. total_vfs
functionality is critical for environments that require flexible num VF
configuration.

3.b) devlink keep_link_up Parameter:
------------------------------------

Introduces a new devlink parameter 'keep_link_up', allowing devices to
keep the link active even when the driver is not loaded. This
functionality is especially useful for maintaining link stability during
driver upgrades or reboots without dropping connectivity.

3.c) eSwitch Hairpin per Priority Buffers:
------------------------------------------

Implements new devlink parameters to configure eSwitch hairpin per
priority buffers. These parameters provide granular control over how
packets are buffered for IEEE802.1p priorities, offering improved traffic
management and efficiency for specific priority levels.

3.d) CQE Compression Type:
--------------------------

Introduces a new devlink parameter, cqe_compress_type, to configure the
rate of CQE compression based on PCIe bus conditions. This setting
provides a balance between compression efficiency and overall NIC
performance under different traffic loads.

Detailed examples of usage for each parameter have been included in the
respective commits.

Jiri Pirko (2):
devlink: define enum for attr types of dynamic attributes
devlink: pass struct devlink_port * as arg to devlink_nl_param_fill()

Saeed Mahameed (9):
net/mlx5: Implement cqe_compress_type via devlink params
devlink: Implement port params registration
devlink: Implement get/dump netlink commands for port params
devlink: Implement set netlink command for port params
devlink: Add 'keep_link_up' generic devlink device param
net/mlx5: Implement devlink keep_link_up port parameter
devlink: Throw extack messages on param value validation error
devlink: Implement devlink param multi attribute nested data values
net/mlx5: Implement eSwitch hairpin per prio buffers devlink params

Vlad Dumitrescu (3):
devlink: Add 'total_vfs' generic device param
net/mlx5: Implement devlink enable_sriov parameter
net/mlx5: Implement devlink total_vfs parameter

Documentation/netlink/specs/devlink.yaml | 45 +-
.../networking/devlink/devlink-params.rst | 7 +
Documentation/networking/devlink/mlx5.rst | 65 +-
.../net/ethernet/mellanox/mlx5/core/Makefile | 2 +-
.../net/ethernet/mellanox/mlx5/core/devlink.c | 9 +
.../net/ethernet/mellanox/mlx5/core/devlink.h | 3 +
.../ethernet/mellanox/mlx5/core/en/devlink.c | 16 +-
.../ethernet/mellanox/mlx5/core/en/devlink.h | 3 +-
.../net/ethernet/mellanox/mlx5/core/en_main.c | 4 +-
.../mellanox/mlx5/core/lib/nv_param.c | 944 ++++++++++++++++++
.../mellanox/mlx5/core/lib/nv_param.h | 16 +
include/linux/mlx5/driver.h | 1 +
include/net/devlink.h | 30 +
include/uapi/linux/devlink.h | 18 +
net/devlink/health.c | 17 +-
net/devlink/netlink_gen.c | 23 +-
net/devlink/param.c | 437 ++++++--
net/devlink/port.c | 3 +
18 files changed, 1536 insertions(+), 107 deletions(-)
create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/lib/nv_param.c
create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/lib/nv_param.h

--
2.48.1