Skip to content

Commit 8deeefb

Browse files
GavinLi-NVSaeed Mahameed
authored andcommitted
Revert "net/mlx5: Block entering switchdev mode with ns inconsistency"
This reverts commit 662404b. The revert is required due to the suspicion it is not good for anything and cause crash. Fixes: 662404b ("net/mlx5e: Block entering switchdev mode with ns inconsistency") Signed-off-by: Gavin Li <[email protected]> Reviewed-by: Jiri Pirko <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 1c61728 commit 8deeefb

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3658,22 +3658,6 @@ static int esw_inline_mode_to_devlink(u8 mlx5_mode, u8 *mode)
36583658
return 0;
36593659
}
36603660

3661-
static bool esw_offloads_devlink_ns_eq_netdev_ns(struct devlink *devlink)
3662-
{
3663-
struct mlx5_core_dev *dev = devlink_priv(devlink);
3664-
struct net *devl_net, *netdev_net;
3665-
bool ret = false;
3666-
3667-
mutex_lock(&dev->mlx5e_res.uplink_netdev_lock);
3668-
if (dev->mlx5e_res.uplink_netdev) {
3669-
netdev_net = dev_net(dev->mlx5e_res.uplink_netdev);
3670-
devl_net = devlink_net(devlink);
3671-
ret = net_eq(devl_net, netdev_net);
3672-
}
3673-
mutex_unlock(&dev->mlx5e_res.uplink_netdev_lock);
3674-
return ret;
3675-
}
3676-
36773661
int mlx5_eswitch_block_mode(struct mlx5_core_dev *dev)
36783662
{
36793663
struct mlx5_eswitch *esw = dev->priv.eswitch;
@@ -3718,13 +3702,6 @@ int mlx5_devlink_eswitch_mode_set(struct devlink *devlink, u16 mode,
37183702
if (esw_mode_from_devlink(mode, &mlx5_mode))
37193703
return -EINVAL;
37203704

3721-
if (mode == DEVLINK_ESWITCH_MODE_SWITCHDEV &&
3722-
!esw_offloads_devlink_ns_eq_netdev_ns(devlink)) {
3723-
NL_SET_ERR_MSG_MOD(extack,
3724-
"Can't change E-Switch mode to switchdev when netdev net namespace has diverged from the devlink's.");
3725-
return -EPERM;
3726-
}
3727-
37283705
mlx5_lag_disable_change(esw->dev);
37293706
err = mlx5_esw_try_lock(esw);
37303707
if (err < 0) {

0 commit comments

Comments
 (0)