Skip to content

Commit

Permalink
net/mlx5: fix match MPLS over GRE with key
Browse files Browse the repository at this point in the history
[ upstream commit 4b1cb50 ]

Currently PMD needs previous layer information in order to set
corresponding match field for MPLSoGRE or MPLSoUDP.

GRE_KEY item is missing as supported previous layer when translate
item MPLS, which causes flow[1] cannot match MPLS over GRE traffic.

According to RFC4023, MPLS over GRE tunnel with optional key
field needs to be supported too.

By adding missing GRE_KEY as supported previous layer fix problem.

[1]:
flow create 0 ingress pattern eth / ipv6 / gre k_bit is 1 / gre_key /
mpls label is 966138 / end actions queue index 1 / mark id 0xa / end

Fixes: a7a0365 ("net/mlx5: match GRE key and present bits")

Signed-off-by: Xiaoyu Min <jackmin@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
  • Loading branch information
jackmin authored and cpaelzer committed Aug 9, 2021
1 parent 9910c05 commit c685b39
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/mlx5/mlx5_flow_dv.c
Expand Up @@ -6221,6 +6221,8 @@ flow_dv_translate_item_mpls(void *matcher, void *key,
MLX5_UDP_PORT_MPLS);
break;
case MLX5_FLOW_LAYER_GRE:
/* Fall-through. */
case MLX5_FLOW_LAYER_GRE_KEY:
MLX5_SET(fte_match_set_misc, misc_m, gre_protocol, 0xffff);
MLX5_SET(fte_match_set_misc, misc_v, gre_protocol,
RTE_ETHER_TYPE_MPLS);
Expand Down

0 comments on commit c685b39

Please sign in to comment.