net/mlx5e: Set vlan masks for all offloaded TC rules
authorJianbo Liu <jianbol@mellanox.com>
Sat, 25 Aug 2018 03:29:58 +0000 (03:29 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Oct 2018 07:16:20 +0000 (09:16 +0200)
commit7ba8867fb3a7fb6ec0b919eb69e539b4bf03b712
tree9bf4311c4bddd8fbc91311bc0188b86705b315d9
parent431a4fee711414dbd14389d62f38adb03dc39e49
net/mlx5e: Set vlan masks for all offloaded TC rules

[ Upstream commit cee26487620bc9bc3c7db21b6984d91f7bae12ae ]

In flow steering, if asked to, the hardware matches on the first ethertype
which is not vlan. It's possible to set a rule as follows, which is meant
to match on untagged packet, but will match on a vlan packet:
    tc filter add dev eth0 parent ffff: protocol ip flower ...

To avoid this for packets with single tag, we set vlan masks to tell
hardware to check the tags for every matched packet.

Fixes: 095b6cfd69ce ('net/mlx5e: Add TC vlan match parsing')
Signed-off-by: Jianbo Liu <jianbol@mellanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c