]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net/mlx5e: fix ingress_ifindex check in mlx5e_flower_parse_meta
authorwenxu <wenxu@ucloud.cn>
Fri, 9 Apr 2021 05:33:48 +0000 (13:33 +0800)
committerSaeed Mahameed <saeedm@nvidia.com>
Wed, 14 Apr 2021 23:13:00 +0000 (16:13 -0700)
In the nft_offload there is the mate flow_dissector with no
ingress_ifindex but with ingress_iftype that only be used
in the software. So if the mask of ingress_ifindex in meta is
0, this meta check should be bypass.

Fixes: acf4ff9eeffd ("net/mlx5e: Add mlx5e_flower_parse_meta support")
Signed-off-by: wenxu <wenxu@ucloud.cn>
Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c

index df2a0af854bbf6c7789585d090589c64d31bc6f6..d675107d9ecabec3a44b8b5124c50432251e459b 100644 (file)
@@ -1895,6 +1895,9 @@ static int mlx5e_flower_parse_meta(struct net_device *filter_dev,
                return 0;
 
        flow_rule_match_meta(rule, &match);
+       if (!match.mask->ingress_ifindex)
+               return 0;
+
        if (match.mask->ingress_ifindex != 0xFFFFFFFF) {
                NL_SET_ERR_MSG_MOD(extack, "Unsupported ingress ifindex mask");
                return -EOPNOTSUPP;