net/mlx5: validate flow rule item order
authorXiaoyu Min <jackmin@mellanox.com>
Wed, 11 Sep 2019 08:46:15 +0000 (16:46 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 23 Oct 2019 14:43:08 +0000 (16:43 +0200)
commit906a2efae8da8507bab2d089c544d4fa4150a5fd
tree26c509c9a2d0ff7bbfbc13043f775f5df65fa022
parentda4880609cba9364752cb4c6d36293fba5d98ccd
net/mlx5: validate flow rule item order

The Item order validation between L2 and L3 is missing, which leading to
the following flow rule is accepted:

  testpmd> flow create 0 ingress pattern ipv4 / eth / end actions drop /
           end

Only the outer L3 layer should check whether the L2 layer is present,
because the L3 layer could directly follow the tunnel layer
without L2 layer.

Meanwhile inner L2 layer should check whether there is inner L3 layer
before it.

Fixes: 23c1d42c7138 ("net/mlx5: split flow validation to dedicated function")
Cc: stable@dpdk.org
Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
drivers/net/mlx5/mlx5_flow.c