From: Xueming Li Date: Mon, 23 Apr 2018 12:33:09 +0000 (+0800) Subject: net/mlx5: allow flow tunnel ID 0 with outer pattern X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=bd315baecf081515d12a8f17d5f1d6c6c5fa7b4a;p=dpdk.git net/mlx5: allow flow tunnel ID 0 with outer pattern Tunnel w/o tunnel id pattern could match any non-tunneled packet, this patch allowed tunnel w/o tunnel id pattern after proper outer spec. Signed-off-by: Xueming Li Acked-by: Nelio Laranjeiro --- diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index a3433b0ee0..8f5fcf4d69 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -1800,7 +1800,8 @@ mlx5_flow_create_vxlan(const struct rte_flow_item *item, * before will also match this rule. * To avoid such situation, VNI 0 is currently refused. */ - if (!vxlan.val.tunnel_id) + /* Only allow tunnel w/o tunnel id pattern after proper outer spec. */ + if (parser->out_layer == HASH_RXQ_ETH && !vxlan.val.tunnel_id) return rte_flow_error_set(data->error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, item,