mirror of
https://github.com/torvalds/linux.git
synced 2024-11-27 06:31:52 +00:00
net/mlx5e: MPLSoUDP decap, fix check for unsupported matches
Currently offload of rule on bareudp device require tunnel key
in order to match on mpls fields and without it the mpls fields
are ignored, this is incorrect due to the fact udp tunnel doesn't
have key to match on.
Fix by returning error in case flow is matching on tunnel key.
Fixes: 72046a91d1
("net/mlx5e: Allow to match on mpls parameters")
Signed-off-by: Maor Dickman <maord@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
This commit is contained in:
parent
c63741b426
commit
fdc18e4e4b
@ -59,37 +59,31 @@ static int parse_tunnel(struct mlx5e_priv *priv,
|
||||
void *headers_v)
|
||||
{
|
||||
struct flow_rule *rule = flow_cls_offload_flow_rule(f);
|
||||
struct flow_match_enc_keyid enc_keyid;
|
||||
struct flow_match_mpls match;
|
||||
void *misc2_c;
|
||||
void *misc2_v;
|
||||
|
||||
misc2_c = MLX5_ADDR_OF(fte_match_param, spec->match_criteria,
|
||||
misc_parameters_2);
|
||||
misc2_v = MLX5_ADDR_OF(fte_match_param, spec->match_value,
|
||||
misc_parameters_2);
|
||||
|
||||
if (!flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_MPLS))
|
||||
return 0;
|
||||
|
||||
if (!flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_ENC_KEYID))
|
||||
return 0;
|
||||
|
||||
flow_rule_match_enc_keyid(rule, &enc_keyid);
|
||||
|
||||
if (!enc_keyid.mask->keyid)
|
||||
return 0;
|
||||
|
||||
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;
|
||||
|
||||
if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_ENC_KEYID))
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
if (!flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_MPLS))
|
||||
return 0;
|
||||
|
||||
flow_rule_match_mpls(rule, &match);
|
||||
|
||||
/* Only support matching the first LSE */
|
||||
if (match.mask->used_lses != 1)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
misc2_c = MLX5_ADDR_OF(fte_match_param, spec->match_criteria,
|
||||
misc_parameters_2);
|
||||
misc2_v = MLX5_ADDR_OF(fte_match_param, spec->match_value,
|
||||
misc_parameters_2);
|
||||
|
||||
MLX5_SET(fte_match_set_misc2, misc2_c,
|
||||
outer_first_mpls_over_udp.mpls_label,
|
||||
match.mask->ls[0].mpls_label);
|
||||
|
Loading…
Reference in New Issue
Block a user