net/mlx5: fix dirty array of actions
authorDekel Peled <dekelp@mellanox.com>
Wed, 5 Feb 2020 06:42:02 +0000 (08:42 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 5 Feb 2020 10:15:53 +0000 (11:15 +0100)
commitff44839929d0bea529be581ba784a48d085ab893
tree39baa484cce1a3042640e95ab94e01970dc1ecb0
parent4f8e6befe7c6045b082dc5b95afd5a1c00e30bf0
net/mlx5: fix dirty array of actions

Previous patch changed the format of struct
mlx5_flow_dv_modify_hdr_resource, to use a flexible array for
modification actions.
In __flow_dv_translate() a union was defined with item of this struct,
and an array of maximal possible size.
Array elements are filled in several functions.
In function flow_dv_convert_action_set_reg(), array element is filled
partially, while the other fields of this array element are left
uninitialized.
This may cause failure of flow_dv_modify_hdr_resource_register()
when calling driver function with the 'dirty' array.

This patch updates flow_dv_convert_action_set_reg(), setting the
selected array element fields while clearing the other fields.
Other functions that fill the same array elements are also updated
for clarity and proofing future use.

Fixes: 024e95759c16 ("net/mlx5: fix modify actions support limitation")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
drivers/net/mlx5/mlx5_flow_dv.c