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)
commitfe1587a7de94912ed75ba5ddbfabf0741f9f8239
tree7be29a8d434b63f8c8a454e709705bdb789209e5
parentd22fcc806b84b9818de08b32e494f3c05dd236c7
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: d1bda7eecd88 ("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