linux-kernelorg-stable/net/devlink
Saeed Mahameed 0e535824d0 devlink: Introduce switchdev_inactive eswitch mode
Adds DEVLINK_ESWITCH_MODE_SWITCHDEV_INACTIVE attribute to UAPI and
documentation.

Before having traffic flow through an eswitch, a user may want to have the
ability to block traffic towards the FDB until FDB is fully programmed and
the user is ready to send traffic to it. For example: when two eswitches
are present for vports in a multi-PF setup, one eswitch may take over the
traffic from the other when the user chooses.
Before this take over, a user may want to first program the inactive
eswitch and then once ready redirect traffic to this new eswitch.

switchdev modes transition semantics:

legacy->switchdev_inactive: Create switchdev mode normally, traffic not
  allowed to flow yet.

switchdev_inactive->switchdev: Enable traffic to flow.

switchdev->switchdev_inactive: Block traffic on the FDB, FDB and
  representros state and content is preserved.

When eswitch is configured to this mode, traffic is ignored/dropped on
this eswitch FDB, while current configuration is kept, e.g FDB rules and
netdev representros are kept available, FDB programming is allowed.

Example:
 # start inactive switchdev
devlink dev eswitch set pci/0000:08:00.1 mode switchdev_inactive
 # setup TC rules, representors etc ..
 # activate
devlink dev eswitch set pci/0000:08:00.1 mode switchdev

Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Link: https://patch.msgid.link/20251108070404.1551708-2-saeed@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2025-11-11 13:17:53 +01:00
..
Makefile devlink: move devlink_notify_register/unregister() to dev.c 2023-08-28 08:02:24 -07:00
core.c net: replace use of system_wq with system_percpu_wq 2025-09-22 17:40:30 -07:00
dev.c devlink: add value check to devlink_info_version_put() 2025-04-15 07:36:31 -07:00
devl_internal.h devlink: introduce devlink_nl_put_u64() 2024-10-29 16:52:56 -07:00
dpipe.c devlink: use devlink_nl_put_u64() helper 2024-10-29 16:52:56 -07:00
health.c devlink: Make health reporter burst period configurable 2025-08-26 17:24:16 -07:00
linecard.c devlink: introduce a helper for netlink multicast send 2023-12-19 15:31:40 +01:00
netlink.c devlink: Fix devlink parallel commands processing 2024-03-13 08:31:40 +00:00
netlink_gen.c devlink: Introduce switchdev_inactive eswitch mode 2025-11-11 13:17:53 +01:00
netlink_gen.h devlink: Fix excessive stack usage in rate TC bandwidth parsing 2025-07-23 17:07:35 -07:00
param.c devlink: Add new "max_mac_per_vf" generic device param 2025-11-06 12:57:31 -08:00
port.c devlink/port: Check attributes early and constify 2025-08-14 17:35:20 -07:00
rate.c devlink rate: Remove unnecessary 'static' from a couple places 2025-09-18 07:47:18 -07:00
region.c devlink: region: correct port region lookup to use port_ops 2025-10-21 17:40:26 -07:00
resource.c devlink: remove unused devlink_resource_register() 2024-10-29 16:52:57 -07:00
sb.c devlink: rename netlink callback to be aligned with the generated ones 2023-10-23 16:12:47 -07:00
trap.c devlink: use devlink_nl_put_u64() helper 2024-10-29 16:52:56 -07:00