[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251016013618.2030940-1-saeed@kernel.org>
Date: Wed, 15 Oct 2025 18:36:15 -0700
From: Saeed Mahameed <saeed@...nel.org>
To: "David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Eric Dumazet <edumazet@...gle.com>
Cc: Saeed Mahameed <saeedm@...dia.com>,
netdev@...r.kernel.org,
Tariq Toukan <tariqt@...dia.com>,
Gal Pressman <gal@...dia.com>,
Leon Romanovsky <leonro@...dia.com>,
mbloch@...dia.com,
Adithya Jayachandran <ajayachandra@...dia.com>,
Jiri Pirko <jiri@...dia.com>
Subject: [PATCH net-next 0/3] devlink eswitch active/inactive state
From: Saeed Mahameed <saeedm@...dia.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@...dia.com>
Signed-off-by: Adithya Jayachandran <ajayachandra@...dia.com>
Reviewed-by: Jiri Pirko <jiri@...dia.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
Powered by blists - more mailing lists