]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net/mlx5: E-Switch, use new cap as condition for mpls over udp
authorEli Cohen <elic@nvidia.com>
Tue, 12 Jan 2021 07:05:26 +0000 (23:05 -0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 13 Jan 2021 23:45:54 +0000 (15:45 -0800)
Use tunnel_stateless_mpls_over_udp instead of
MLX5_FLEX_PROTO_CW_MPLS_UDP since new devices have native support for
mpls over udp and do not rely on flex parser.

Signed-off-by: Eli Cohen <elic@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_mplsoudp.c

index 1f95262442221b51df168a1f53e6b34f88792f7f..3479672e84cf4659cd0157a61ecfdec7b7d709af 100644 (file)
@@ -81,8 +81,8 @@ static int parse_tunnel(struct mlx5e_priv *priv,
        if (!enc_keyid.mask->keyid)
                return 0;
 
-       if (!(MLX5_CAP_GEN(priv->mdev, flex_parser_protocols) &
-             MLX5_FLEX_PROTO_CW_MPLS_UDP))
+       if (!MLX5_CAP_ETH(priv->mdev, tunnel_stateless_mpls_over_udp) &&
+           !(MLX5_CAP_GEN(priv->mdev, flex_parser_protocols) & MLX5_FLEX_PROTO_CW_MPLS_UDP))
                return -EOPNOTSUPP;
 
        flow_rule_match_mpls(rule, &match);