net/mlx5: allow flow tunnel ID 0 with outer pattern
authorXueming Li <xuemingl@mellanox.com>
Mon, 23 Apr 2018 12:33:09 +0000 (20:33 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 27 Apr 2018 17:00:56 +0000 (18:00 +0100)
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 <xuemingl@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
drivers/net/mlx5/mlx5_flow.c

index a3433b0..8f5fcf4 100644 (file)
@@ -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,