Skip to content

devlink: Add boot-time eswitch mode defaults

Tariq Toukan linux-doc linux-rdma lkml netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 16 repliesIn review

Changes in v1 from the cover letter

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3net/mlx5: Clear FW reset-in-progress bit before reloaddrivers/net/ethernet/mellanox/mlx5/core/fw_reset.c+17 -110 replies
2/3devlink: Add eswitch mode boot defaultsDocumentation/admin-guide/kernel-parameters.txt Documentation/networking/devlink/devlink-defaults.rst Documentation/networking/devlink/index.rst +2 more+362 -00 replies
3/3net/mlx5: Apply devlink default eswitch mode during initdrivers/net/ethernet/mellanox/mlx5/core/main.c+17 -014 replies

Reviews trailers per patch

2 of 3 patches have a Reviewed-by or Acked-by.

PatchShay DroriMoshe Shemesh
1/3R-b R-b
2/3
3/3R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH net-next 0/3] devlink: Add boot-time eswitch mode defaults

Hi,

See detailed feature description by Mark below.

Regards,
Tariq

This series adds a devlink_eswitch_mode= kernel command line parameter for applying a default devlink eswitch mode during device initialization.

Following the discussion with Jakub[1] and the feedback on the RFC postings, this version implements the direction that was agreed on: keep the scope limited to a boot-time devlink eswitch mode default only.

The implementation is intended to support the following properties:

- A system may have multiple devlink devices that usually need the same configuration. For a configuration such as eswitch mode switchdev, a user can specify either all devlink devices or an explicit list of devices to which that mode applies.

- Deployments can set the devlink eswitch mode before normal userspace orchestration runs, while still using devlink concepts and driver callbacks rather than adding driver-specific module parameters.

A default is scoped to either all devlink handles or to a comma-separated list of devlink handles, for example:

devlink_eswitch_mode=[*]:switchdev devlink_eswitch_mode=[pci/0000:08:00.0,pci/0000:09:00.1]:switchdev_inactive

The supported modes are legacy, switchdev and switchdev_inactive.

mlx5 wires this into device initialization after the devlink instance is registered and after mlx5 devlink operations are available, so eswitch mode defaults can be applied to matching PCI devlink devices.

Patch 1 clears the mlx5 FW reset-in-progress bit before reloading after a firmware reset.

Patch 2 adds the devlink eswitch mode boot-default parser, storage, devl_apply_default_esw_mode() API and documentation for the devlink_eswitch_mode= syntax.

Patch 3 calls devl_apply_default_esw_mode() from mlx5 device initialization.

Changelog:

Since RFC v2:

- Replaced the generic devlink=[...]:esw:mode:<mode> command line API with devlink_eswitch_mode=[...]:<mode>.

- Simplified the parser to handle one eswitch mode parameter instead of a generic command/attribute grammar.

- Renamed devl_apply_defaults() to devl_apply_default_esw_mode().

- Added the mlx5 firmware reset cleanup as the first patch after the cover letter.

[1] https://lore.kernel.org/all/[email protected]/

RFC V1:
https://lore.kernel.org/all/[email protected]/

RFC V2:
https://lore.kernel.org/all/[email protected]/

Mark Bloch (3):
net/mlx5: Clear FW reset-in-progress bit before reload
devlink: Add eswitch mode boot defaults net/mlx5: Apply devlink default eswitch mode during init

 .../admin-guide/kernel-parameters.txt         |  25 ++
 .../networking/devlink/devlink-defaults.rst   |  80 ++++++
 Documentation/networking/devlink/index.rst    |   1 +
 .../ethernet/mellanox/mlx5/core/fw_reset.c    |  28 +-
 .../net/ethernet/mellanox/mlx5/core/main.c    |  17 ++
 include/net/devlink.h                         |   1 +
 net/devlink/core.c                            | 255 ++++++++++++++++++
 7 files changed, 396 insertions(+), 11 deletions(-)
 create mode 100644 Documentation/networking/devlink/devlink-defaults.rst

base-commit: 9bf93cb2e180a58d5984ba13daee95903ff4fc14

Signature · 1 line
2.44.0