]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5e: Fix matching on tunnel addresses type
authorDmytro Linkin <dmitrolin@mellanox.com>
Fri, 13 Sep 2019 10:42:21 +0000 (10:42 +0000)
committerSaeed Mahameed <saeedm@mellanox.com>
Tue, 24 Sep 2019 09:38:08 +0000 (12:38 +0300)
commite61bc53d4e37edbc29004fd5e1a62f6c359a79f5
tree7be29a8d434b63f8c8a454e709705bdb789209e5
parent1efc5d4f85a8fe91c65b401ac985ee839baa292d
net/mlx5e: Fix matching on tunnel addresses type

In mlx5 parse_tunnel_attr() function dispatch on encap IP address type
is performed by directly checking flow_rule_match_key() on
FLOW_DISSECTOR_KEY_ENC_IPV4_ADDRS, and then on
FLOW_DISSECTOR_KEY_ENC_IPV6_ADDRS. However, since those are stored in
union, first check is always true if any type of encap address is set,
which leads to IPv6 tunnel encap address being parsed as IPv4 by mlx5.
Determine correct IP address type by checking control key first and if
it set, take address type from match.key->addr_type.

Fixes: 572f74e6fe9b ("net/mlx5e: Allow matching only enc_key_id/enc_dst_port for decapsulation action")
Signed-off-by: Dmytro Linkin <dmitrolin@mellanox.com>
Reviewed-by: Vlad Buslov <vladbu@mellanox.com>
Reviewed-by: Eli Britstein <elibr@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c