]> git.droids-corp.org - dpdk.git/commitdiff
net/mlx5: validate MPLSoGRE with GRE key
authorXiaoyu Min <jackmin@nvidia.com>
Tue, 10 Nov 2020 11:59:53 +0000 (19:59 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 13 Nov 2020 22:36:14 +0000 (23:36 +0100)
Currently PMD only accept flow which item_mpls directly follow item_gre,
means to match the GRE header without GRE optional field key in MPLSoGRE
encapsulation.

However, for the MPLSoGRE, the GRE header could have the optional field
(i.e, key) according to the RFC. So PMD need to accept this.

Add MLX5_FLOW_LAYER_GRE_KEY into allowed prev_layer to fix

Fixes: a7a0365565a4 ("net/mlx5: match GRE key and present bits")
Cc: stable@dpdk.org
Signed-off-by: Xiaoyu Min <jackmin@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
drivers/net/mlx5/mlx5_flow.c

index 0ee34001a0f6a2a5c2f4114f5ef8501cf2473aff..53a8a75cc0b2a1990e2eab03407a48e6cadb3758 100644 (file)
@@ -2746,7 +2746,8 @@ mlx5_flow_validate_item_mpls(struct rte_eth_dev *dev __rte_unused,
        /* MPLS over IP, UDP, GRE is allowed */
        if (!(prev_layer & (MLX5_FLOW_LAYER_OUTER_L3 |
                            MLX5_FLOW_LAYER_OUTER_L4_UDP |
-                           MLX5_FLOW_LAYER_GRE)))
+                           MLX5_FLOW_LAYER_GRE |
+                           MLX5_FLOW_LAYER_GRE_KEY)))
                return rte_flow_error_set(error, EINVAL,
                                          RTE_FLOW_ERROR_TYPE_ITEM, item,
                                          "protocol filtering not compatible"