Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
* [RFC V2 net-next 0/2] devlink: Add boot-time defaults
@ 2026-05-10 18:54 Mark Bloch
  2026-05-10 18:54 ` [RFC V2 net-next 1/2] devlink: Add eswitch mode boot defaults Mark Bloch
  2026-05-10 18:54 ` [RFC V2 net-next 2/2] net/mlx5: Apply devlink boot defaults during init Mark Bloch
  0 siblings, 2 replies; 3+ messages in thread
From: Mark Bloch @ 2026-05-10 18:54 UTC (permalink / raw)
  To: Eric Dumazet, Jakub Kicinski, Paolo Abeni, Andrew Lunn,
	David S. Miller, Jiri Pirko
  Cc: Jonathan Corbet, Shuah Khan, Simon Horman, Saeed Mahameed,
	Leon Romanovsky, Tariq Toukan, Mark Bloch, Andrew Morton,
	Borislav Petkov (AMD), Randy Dunlap, Petr Mladek,
	Peter Zijlstra (Intel), Christian Brauner, Thomas Gleixner,
	Dapeng Mi, Kees Cook, Marco Elver, Li RongQing, Eric Biggers,
	Paul E. McKenney, linux-doc, linux-kernel, netdev, linux-rdma

This series adds a devlink= kernel command line parameter for applying
selected devlink settings during device initialization.

Following a discussion with Jakub[1], I am sending this RFC to get the
conversation moving. I started from Jakub's example/request and extended
it to cover requirements from production systems and configurations that
customers use. 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 configuration applies.

- Deployments can set devlink defaults 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=[*]:esw:mode:switchdev
devlink=[pci/0000:08:00.0,pci/0000:09:00.1]:esw:mode:switchdev_inactive

The first supported command is eswitch mode configuration.

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 adds the devlink boot-default parser, storage,
devl_apply_defaults() API, eswitch mode default support and documentation
for the devlink= syntax.

Patch 2 calls devl_apply_defaults() from mlx5 device initialization.

Changelog:

V1 -> V2

- Reduced the series from 4 patches to 2 patches by folding the generic
boot default infrastructure and eswitch mode support into one devlink
patch.

- Narrowed the scope to eswitch mode defaults only. Dropped runtime
devlink parameter boot defaults and simplified parser.

- Added [*] selector support to apply the same eswitch mode default to all
devlink instances.

- Removed support for multiple comma-separated default groups and for
assigning different defaults to different handles in the same devlink=
parameter.

[1] https://lore.kernel.org/all/20260502184153.4fd8d06f@kernel.org/
V1 : https://lore.kernel.org/all/20260506123739.1959770-1-mbloch@nvidia.com/

Mark Bloch (2):
  devlink: Add eswitch mode boot defaults
  net/mlx5: Apply devlink boot defaults during init

 .../admin-guide/kernel-parameters.txt         |  24 ++
 .../networking/devlink/devlink-defaults.rst   |  93 ++++++
 Documentation/networking/devlink/index.rst    |   1 +
 .../net/ethernet/mellanox/mlx5/core/main.c    |   2 +
 include/net/devlink.h                         |   1 +
 net/devlink/core.c                            | 269 ++++++++++++++++++
 6 files changed, 390 insertions(+)
 create mode 100644 Documentation/networking/devlink/devlink-defaults.rst


base-commit: a93245816556ba03549bb626de48ea2b11c7f9d2
-- 
2.34.1


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

end of thread, other threads:[~2026-05-10 18:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-10 18:54 [RFC V2 net-next 0/2] devlink: Add boot-time defaults Mark Bloch
2026-05-10 18:54 ` [RFC V2 net-next 1/2] devlink: Add eswitch mode boot defaults Mark Bloch
2026-05-10 18:54 ` [RFC V2 net-next 2/2] net/mlx5: Apply devlink boot defaults during init Mark Bloch

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