]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5: E-Switch, Don't allow changing inline mode when flows are configured
authorRoi Dayan <roid@mellanox.com>
Tue, 21 Mar 2017 13:59:14 +0000 (15:59 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 22 Mar 2017 19:11:12 +0000 (12:11 -0700)
commit7ea6ed8b7a9f518f794f8ca85ea9d6d0a775a3d8
tree26c87f5a286d8f6289ad158bae4f0955756de1a3
parenta67879c4c9eb065c0dacefce61d1287b45a96b25
net/mlx5: E-Switch, Don't allow changing inline mode when flows are configured

Changing the eswitch inline mode can potentially cause already configured
flows not to match the policy. E.g. set policy L4, add some L4 rules,
set policy to L2 --> bad! Hence we disallow it.

Keep track of how many offloaded rules are now set and refuse
inline mode changes if this isn't zero.

Fixes: 2b0d9e87016e ("net/mlx5: E-Switch, Add control for inline mode")
Signed-off-by: Roi Dayan <roid@mellanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c