]> 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)
commitd97c25edf952c94cab7cfda404ecc20394898180
tree26c87f5a286d8f6289ad158bae4f0955756de1a3
parentf7c637faad7c7f82aae68d626d3f6d2ebce72246
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: 5b9bb17fe0c3 ("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