mlxsw: spectrum_acl: Track rules that forbid egress block bind
authorJiri Pirko <jiri@mellanox.com>
Sat, 27 Jul 2019 17:32:56 +0000 (20:32 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sat, 27 Jul 2019 21:32:31 +0000 (14:32 -0700)
commitc9588e28123c563a355964c6ee8ca5dd28aebd6a
treeb6a8b5bf1812d3f3c696862f3adc20d2523ae85c
parent185556f092491120ea2bd7eab6f9f78ff6c4d6d0
mlxsw: spectrum_acl: Track rules that forbid egress block bind

Some matches and actions are not supported on egress. Track such rules
and forbid a bind of block which contains them to egress.

With this patch, the kernel tells the user he cannot do that:
$ tc qdisc add dev ens16np1 ingress_block 22 clsact
$ tc filter add block 22 protocol 802.1q pref 2 handle 101 flower vlan_id 100 skip_sw action pass
$ tc qdisc add dev ens16np2 egress_block 22 clsact
Error: mlxsw_spectrum: Block cannot be bound to egress because it contains unsupported rules.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum.c
drivers/net/ethernet/mellanox/mlxsw/spectrum.h
drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c
drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c