From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yongseok Koh Subject: [PATCH] net/mlx5: fix sanity check for MPLS-in-GRE Date: Fri, 3 Aug 2018 15:00:56 -0700 Message-ID: <20180803220056.22840-1-yskoh@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain Cc: dev@dpdk.org, Yongseok Koh To: shahafs@mellanox.com Return-path: Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20073.outbound.protection.outlook.com [40.107.2.73]) by dpdk.org (Postfix) with ESMTP id B8EF71B5C3 for ; Sat, 4 Aug 2018 00:01:14 +0200 (CEST) List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Multiple tunnel isn't allowed but MPLS over GRE should be accepted. Fixes: a4a5cd21d20a ("net/mlx5: add flow MPLS item") Signed-off-by: Yongseok Koh --- drivers/net/mlx5/mlx5_flow.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index b7500ec9d6..ca4625b699 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -1778,7 +1778,9 @@ mlx5_flow_item_mpls(const struct rte_flow_item *item __rte_unused, item, "protocol filtering not compatible" " with MPLS layer"); - if (flow->layers & MLX5_FLOW_LAYER_TUNNEL) + /* Multi-tunnel isn't allowed but MPLS over GRE is an exception. */ + if (flow->layers & MLX5_FLOW_LAYER_TUNNEL && + (flow->layers & MLX5_FLOW_LAYER_GRE) != MLX5_FLOW_LAYER_GRE) return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ITEM, item, -- 2.11.0