Skip to content

Commit

Permalink
net/mlx5: reject inner ethernet matching in GTP
Browse files Browse the repository at this point in the history
[ upstream commit 4e5ba38 ]

The user is able to create a flow rule pattern with ETH after GTP
although it is not supported by the flex-parser configuration.

Failed the rule validation in such case with proper error message.

Fixes: 23c1d42 ("net/mlx5: split flow validation to dedicated function")

Signed-off-by: Lior Margalit <lmargalit@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
  • Loading branch information
liormargalit authored and bluca committed Jul 26, 2021
1 parent cf3ae20 commit d0213e2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/net/mlx5/mlx5_flow.c
Expand Up @@ -1914,6 +1914,10 @@ mlx5_flow_validate_item_eth(const struct rte_flow_item *item,
return rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ITEM, item,
"L2 layer should not follow VLAN");
if (item_flags & MLX5_FLOW_LAYER_GTP)
return rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ITEM, item,
"L2 layer should not follow GTP");
if (!mask)
mask = &rte_flow_item_eth_mask;
ret = mlx5_flow_item_acceptable(item, (const uint8_t *)mask,
Expand Down

0 comments on commit d0213e2

Please sign in to comment.