mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 21:57:43 +00:00
net/mlx5: Fix setting of devlink traps in switchdev mode
Prevent setting of devlink traps on the uplink while in switchdev mode.
In this mode, it is the SW switch responsibility to handle both packets
with a mismatch in destination MAC or VLAN ID. Therefore, there are no
flow steering tables to trap undesirable packets and driver crashes upon
setting a trap.
Fixes: 241dc15939
("net/mlx5: Notify on trap action by blocking event")
Signed-off-by: Aya Levin <ayal@nvidia.com>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
This commit is contained in:
parent
2afeec08ab
commit
41bafb31dc
1 changed files with 5 additions and 0 deletions
|
@ -246,6 +246,11 @@ static int mlx5_devlink_trap_action_set(struct devlink *devlink,
|
|||
struct mlx5_devlink_trap *dl_trap;
|
||||
int err = 0;
|
||||
|
||||
if (is_mdev_switchdev_mode(dev)) {
|
||||
NL_SET_ERR_MSG_MOD(extack, "Devlink traps can't be set in switchdev mode");
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
dl_trap = mlx5_find_trap_by_id(dev, trap->id);
|
||||
if (!dl_trap) {
|
||||
mlx5_core_err(dev, "Devlink trap: Set action on invalid trap id 0x%x", trap->id);
|
||||
|
|
Loading…
Reference in a new issue