From: wenxu Date: Fri, 9 Apr 2021 05:33:48 +0000 (+0800) Subject: net/mlx5e: fix ingress_ifindex check in mlx5e_flower_parse_meta X-Git-Tag: rel_imx_5.10.35_2.0.0-somdevices.0~104^2~110 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=cda5507d234fe6564a30e27436cb7758d1d3fccd;p=linux.git net/mlx5e: fix ingress_ifindex check in mlx5e_flower_parse_meta commit e3e0f9b279705154b951d579dc3d8b7041710e24 upstream. 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: 6d65bc64e232 ("net/mlx5e: Add mlx5e_flower_parse_meta support") Signed-off-by: wenxu Acked-by: Pablo Neira Ayuso Signed-off-by: Saeed Mahameed Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c index 930f19c598bb..3079a82f1f41 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c @@ -2196,6 +2196,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;