netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/3] devlink eswitch active/inactive state
@ 2025-10-16  1:36 Saeed Mahameed
  2025-10-16  1:36 ` [PATCH net-next 1/3] devlink: Introduce devlink eswitch state Saeed Mahameed
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Saeed Mahameed @ 2025-10-16  1:36 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski, Paolo Abeni, Eric Dumazet
  Cc: Saeed Mahameed, netdev, Tariq Toukan, Gal Pressman,
	Leon Romanovsky, mbloch, Adithya Jayachandran, Jiri Pirko

From: Saeed Mahameed <saeedm@nvidia.com>

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.

This series introduces a user-configurable states for an eswitch that allows
dynamically switching between active and inactive states. When inactive, traffic
does not flow through the eswitch. While inactive, steering pipeline
configuration can be done (e.g. adding TC rules, discovering representors,
enabling the desired SDN modes such as bridge/OVS/DPDK/etc). Once configuration
is completed, a user can set the eswitch state to active and have traffic flow
through. This allows admins to upgrade forwarding pipeline rules with very
minimal downtime and packet drops.

A user can start the eswitch in switchdev mode in either active or inactive
state. To preserve backwards compatibility, the default state is active.

Active: Traffic is enabled on this eswitch FDB.
Inactive: Traffic is ignored/dropped on this eswitch FDB.

An example of starting the switch in active state is following.
  1. Default is active (backward compatible)
$ devlink dev eswitch set pci/0000:08:00.1 mode switchdev

  2. Explicitly set the state
$ devlink dev eswitch set pci/0000:08:00.1 mode switchdev state active

To bring up the esw in 'inactive' state:

$ devlink dev eswitch set pci/0000:08:00.1 mode switchdev state inactive

When querying the eswitch, we also see the state of it:

$ devlink dev eswitch show pci/0000:01:01.0
pci/0000:01:01.0: mode switchdev inline-mode none encap-mode basic state inactive

Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Adithya Jayachandran <ajayachandra@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>

Parav Pandit (1):
  devlink: Introduce devlink eswitch state

Saeed Mahameed (2):
  net/mlx5: MPFS, add support for dynamic enable/disable
  net/mlx5: E-Switch, support eswitch state

 Documentation/netlink/specs/devlink.yaml      |  13 ++
 .../devlink/devlink-eswitch-attr.rst          |  15 ++
 .../net/ethernet/mellanox/mlx5/core/devlink.c |   2 +
 .../mellanox/mlx5/core/esw/adj_vport.c        |  15 +-
 .../net/ethernet/mellanox/mlx5/core/eswitch.c |   1 +
 .../net/ethernet/mellanox/mlx5/core/eswitch.h |  12 ++
 .../mellanox/mlx5/core/eswitch_offloads.c     | 157 ++++++++++++++++++
 .../net/ethernet/mellanox/mlx5/core/fs_core.c |   5 +
 .../ethernet/mellanox/mlx5/core/lib/mpfs.c    | 111 +++++++++++--
 .../ethernet/mellanox/mlx5/core/lib/mpfs.h    |   9 +
 include/linux/mlx5/fs.h                       |   1 +
 include/net/devlink.h                         |   5 +
 include/uapi/linux/devlink.h                  |   7 +
 net/devlink/dev.c                             |  30 ++++
 net/devlink/netlink_gen.c                     |   5 +-
 15 files changed, 358 insertions(+), 30 deletions(-)

-- 
2.51.0


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

end of thread, other threads:[~2025-10-18  7:42 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-16  1:36 [PATCH net-next 0/3] devlink eswitch active/inactive state Saeed Mahameed
2025-10-16  1:36 ` [PATCH net-next 1/3] devlink: Introduce devlink eswitch state Saeed Mahameed
2025-10-16  9:16   ` Jiri Pirko
2025-10-16 17:34     ` Saeed Mahameed
2025-10-17  8:06       ` Jiri Pirko
2025-10-16  1:36 ` [PATCH net-next 2/3] net/mlx5: MPFS, add support for dynamic enable/disable Saeed Mahameed
2025-10-16 19:28   ` kernel test robot
2025-10-16 21:35   ` kernel test robot
2025-10-18  7:42   ` kernel test robot
2025-10-16  1:36 ` [PATCH net-next 3/3] net/mlx5: E-Switch, support eswitch state Saeed Mahameed
2025-10-16 14:54   ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).