|
| 1 | +Revert "net/mlx5: Block entering switchdev mode with ns inconsistency" |
| 2 | + |
| 3 | +jira LE-1907 |
| 4 | +cve CVE-2023-52658 |
| 5 | +Rebuild_History Non-Buildable kernel-5.14.0-427.40.1.el9_4 |
| 6 | +commit-author Gavin Li <gavinl@nvidia.com> |
| 7 | +commit 8deeefb24786ea7950b37bde4516b286c877db00 |
| 8 | +Empty-Commit: Cherry-Pick Conflicts during history rebuild. |
| 9 | +Will be included in final tarball splat. Ref for failed cherry-pick at: |
| 10 | +ciq/ciq_backports/kernel-5.14.0-427.40.1.el9_4/8deeefb2.failed |
| 11 | + |
| 12 | +This reverts commit 662404b24a4c4d839839ed25e3097571f5938b9b. |
| 13 | +The revert is required due to the suspicion it is not good for anything |
| 14 | +and cause crash. |
| 15 | + |
| 16 | +Fixes: 662404b24a4c ("net/mlx5e: Block entering switchdev mode with ns inconsistency") |
| 17 | + Signed-off-by: Gavin Li <gavinl@nvidia.com> |
| 18 | + Reviewed-by: Jiri Pirko <jiri@nvidia.com> |
| 19 | + Signed-off-by: Saeed Mahameed <saeedm@nvidia.com> |
| 20 | +(cherry picked from commit 8deeefb24786ea7950b37bde4516b286c877db00) |
| 21 | + Signed-off-by: Jonathan Maple <jmaple@ciq.com> |
| 22 | + |
| 23 | +# Conflicts: |
| 24 | +# drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c |
| 25 | +diff --cc drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c |
| 26 | +index e58fcd7d4d6d,14b3bd3c5e2f..000000000000 |
| 27 | +--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c |
| 28 | ++++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c |
| 29 | +@@@ -3382,20 -3658,34 +3382,51 @@@ static int esw_inline_mode_to_devlink(u |
| 30 | + return 0; |
| 31 | + } |
| 32 | + |
| 33 | +++<<<<<<< HEAD |
| 34 | + +static bool esw_offloads_devlink_ns_eq_netdev_ns(struct devlink *devlink) |
| 35 | + +{ |
| 36 | + + struct mlx5_core_dev *dev = devlink_priv(devlink); |
| 37 | + + struct net *devl_net, *netdev_net; |
| 38 | + + bool ret = false; |
| 39 | + + |
| 40 | + + mutex_lock(&dev->mlx5e_res.uplink_netdev_lock); |
| 41 | + + if (dev->mlx5e_res.uplink_netdev) { |
| 42 | + + netdev_net = dev_net(dev->mlx5e_res.uplink_netdev); |
| 43 | + + devl_net = devlink_net(devlink); |
| 44 | + + ret = net_eq(devl_net, netdev_net); |
| 45 | + + } |
| 46 | + + mutex_unlock(&dev->mlx5e_res.uplink_netdev_lock); |
| 47 | + + return ret; |
| 48 | +++======= |
| 49 | ++ int mlx5_eswitch_block_mode(struct mlx5_core_dev *dev) |
| 50 | ++ { |
| 51 | ++ struct mlx5_eswitch *esw = dev->priv.eswitch; |
| 52 | ++ int err; |
| 53 | ++ |
| 54 | ++ if (!mlx5_esw_allowed(esw)) |
| 55 | ++ return 0; |
| 56 | ++ |
| 57 | ++ /* Take TC into account */ |
| 58 | ++ err = mlx5_esw_try_lock(esw); |
| 59 | ++ if (err < 0) |
| 60 | ++ return err; |
| 61 | ++ |
| 62 | ++ esw->offloads.num_block_mode++; |
| 63 | ++ mlx5_esw_unlock(esw); |
| 64 | ++ return 0; |
| 65 | ++ } |
| 66 | ++ |
| 67 | ++ void mlx5_eswitch_unblock_mode(struct mlx5_core_dev *dev) |
| 68 | ++ { |
| 69 | ++ struct mlx5_eswitch *esw = dev->priv.eswitch; |
| 70 | ++ |
| 71 | ++ if (!mlx5_esw_allowed(esw)) |
| 72 | ++ return; |
| 73 | ++ |
| 74 | ++ down_write(&esw->mode_lock); |
| 75 | ++ esw->offloads.num_block_mode--; |
| 76 | ++ up_write(&esw->mode_lock); |
| 77 | +++>>>>>>> 8deeefb24786 (Revert "net/mlx5: Block entering switchdev mode with ns inconsistency") |
| 78 | + } |
| 79 | + |
| 80 | + int mlx5_devlink_eswitch_mode_set(struct devlink *devlink, u16 mode, |
| 81 | +* Unmerged path drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c |
0 commit comments