Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
[linux-2.6-microblaze.git] / drivers / net / ethernet / mellanox / mlx5 / core / steering / dr_rule.c
index 5dcb8ba..8560460 100644 (file)
@@ -954,12 +954,12 @@ static int dr_rule_destroy_rule(struct mlx5dr_rule *rule)
        return 0;
 }
 
-static bool dr_rule_is_ipv6(struct mlx5dr_match_param *param)
+static enum mlx5dr_ipv dr_rule_get_ipv(struct mlx5dr_match_spec *spec)
 {
-       return (param->outer.ip_version == 6 ||
-               param->inner.ip_version == 6 ||
-               param->outer.ethertype == ETH_P_IPV6 ||
-               param->inner.ethertype == ETH_P_IPV6);
+       if (spec->ip_version == 6 || spec->ethertype == ETH_P_IPV6)
+               return DR_RULE_IPV6;
+
+       return DR_RULE_IPV4;
 }
 
 static bool dr_rule_skip(enum mlx5dr_domain_type domain,
@@ -1023,7 +1023,8 @@ dr_rule_create_rule_nic(struct mlx5dr_rule *rule,
 
        ret = mlx5dr_matcher_select_builders(matcher,
                                             nic_matcher,
-                                            dr_rule_is_ipv6(param));
+                                            dr_rule_get_ipv(&param->outer),
+                                            dr_rule_get_ipv(&param->inner));
        if (ret)
                goto out_err;