net/mlx5: fix MPLS item validation
authorDekel Peled <dekelp@mellanox.com>
Thu, 15 Nov 2018 15:17:13 +0000 (17:17 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 16 Nov 2018 09:45:37 +0000 (10:45 +0100)
commit38f7efaaf5ac7894bfd852b812e6ba3258ceffb4
tree0a8f4bdaba6755c81cbae84161a18a3692f015a1
parentd1abe664dddea18745005ca13126981e8eeb3b27
net/mlx5: fix MPLS item validation

Update the mlx5_flow_validate_item_mpls() function to allow
MPLS over IP, UDP, and GRE.
Modify the flow_dv_validate() function with the new logic introduced
in previous patch of this series: set new variable last_item
after each validation, update item_flags after each item iteration.
The new variable last_item is sent to mlx5_flow_validate_item_mpls()
and used to validate the MPLS item.
Same change implemented in flow_verbs_validate().

Update the mlx5_flow_validate_item_mpls() function to verify that
device configuration has mpls_en set to 1.
This code was added earlier this year, but unintentionaly removed
in recent versions.

Fixes: 84c406e74524 ("net/mlx5: add flow translate function")

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
drivers/net/mlx5/mlx5_flow.c
drivers/net/mlx5/mlx5_flow.h
drivers/net/mlx5/mlx5_flow_dv.c
drivers/net/mlx5/mlx5_flow_verbs.c