]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net/mlx5: SD, enable SD over ECPF and allow switchdev transition
authorShay Drory <shayd@nvidia.com>
Fri, 12 Jun 2026 11:39:04 +0000 (14:39 +0300)
committerJakub Kicinski <kuba@kernel.org>
Mon, 15 Jun 2026 18:40:51 +0000 (11:40 -0700)
Remove the restriction blocking SD on embedded CPU PFs (ECPF), enabling
SD functionality on BlueField DPUs. Remove the blocker preventing SD
devices from transitioning to switchdev mode.

The infrastructure added in earlier patches properly handles this case.

Signed-off-by: Shay Drory <shayd@nvidia.com>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20260612113904.537595-16-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
drivers/net/ethernet/mellanox/mlx5/core/lib/sd.c

index 8fa7e633451ccd126912ad8586babcdc33055dc4..907ee83a722d2f2c75ce38a0986a09d0b2e5df73 100644 (file)
@@ -4472,12 +4472,6 @@ int mlx5_devlink_eswitch_mode_set(struct devlink *devlink, u16 mode,
        if (esw_mode_from_devlink(mode, &mlx5_mode))
                return -EINVAL;
 
-       if (mlx5_mode == MLX5_ESWITCH_OFFLOADS && mlx5_get_sd(esw->dev)) {
-               NL_SET_ERR_MSG_MOD(extack,
-                                  "Can't change E-Switch mode to switchdev when multi-PF netdev (Socket Direct) is configured.");
-               return -EPERM;
-       }
-
        /* Avoid try_lock, active/inactive mode change is not restricted */
        if (mlx5_devlink_switchdev_active_mode_change(esw, mode))
                return 0;
index 2fcccd329eb5d8aed530d0df98f96dc70f591cde..ee2fdefa1945fe739790979ac2aef70da95a679e 100644 (file)
@@ -222,10 +222,6 @@ bool mlx5_sd_is_supported(struct mlx5_core_dev *dev)
        if (!mlx5_core_is_pf(dev))
                return false;
 
-       /* Block on embedded CPU PFs */
-       if (mlx5_core_is_ecpf(dev))
-               return false;
-
        err = mlx5_query_nic_vport_sd_group(dev, &sd_group);
        if (err || !sd_group)
                return false;
@@ -252,10 +248,6 @@ static int sd_init(struct mlx5_core_dev *dev)
        if (!mlx5_core_is_pf(dev))
                return 0;
 
-       /* Block on embedded CPU PFs */
-       if (mlx5_core_is_ecpf(dev))
-               return 0;
-
        err = mlx5_query_nic_vport_sd_group(dev, &sd_group);
        if (err)
                return err;