net/mlx5: fix 32-bit arch compilation issue
PATCH 1/1 net/mlx5: fix 32-bit arch compilation issue
There is a "cast to pointer from integer of different size" compilation failure on 32-bit machines introduced by the RTE_FLOW_ACTION_TYPE_MODIFY_FIELD implementation in mlx5 PMD.
Cast the specified value to be used as RTE_FLOW_FIELD_POINTER to a pointer with an appropriate size suited for underlying arch. Please squash this patch into the original commit if possible.
--- drivers/net/mlx5/mlx5_flow_dv.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/mlx5/mlx5_flow_dv.c +4 -2
@@ -1749,7 +1749,9 @@ mlx5_flow_field_id_to_modify_infocase RTE_FLOW_FIELD_POINTER :for (idx =0 ; idx <MLX5_ACT_MAX_MOD_FIELDS ; idx++) {if (mask[idx]) { - value[idx] =RTE_BE32 (*(uint64_t *)data->value); +memcpy (&value[idx], + (void *)(uintptr_t )data->value,32 ); + value[idx] =RTE_BE32 (value[idx]);break ; } }
@@ -1757,7 +1759,7 @@ mlx5_flow_field_id_to_modify_infocase RTE_FLOW_FIELD_VALUE :for (idx =0 ; idx <MLX5_ACT_MAX_MOD_FIELDS ; idx++) {if (mask[idx]) { - value[idx] =RTE_BE32 (data->value); + value[idx] =RTE_BE32 ((uint32_t )data->value);break ; } }
Signature · 1 line
2.24.1
Quoted 11 lines · Alexander Kozyrev
There is a "cast to pointer from integer of different size" compilation failure on 32-bit machines introduced by the
RTE_FLOW_ACTION_TYPE_MODIFY_FIELDimplementation in mlx5 PMD.Cast the specified value to be used as
RTE_FLOW_FIELD_POINTERto a pointer with an appropriate size suited for underlying arch. Please squash this patch into the original commit if possible.Fixes 80ec1e84a4 ("net/mlx5: support modify field flow action")Signed-off-by Alexander Kozyrev <[email protected]>
Squashed into relevant commit in next-net, thanks.