Skip to content

Commit

Permalink
net/mlx5: fix warning about copy length
Browse files Browse the repository at this point in the history
[ upstream commit c19580fb8e9ad6f153d46f731ec7cd2050b3021b ]

Use RTE_PTR_ADD where copying to the offset of a field in a structure
holding multiple fields, to avoid compiler warnings with decorated
rte_memcpy.

Fixes: 16a7dbc ("net/mlx5: make flow modify action list thread safe")

Signed-off-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
  • Loading branch information
MortenBroerup authored and kevintraynor committed Apr 3, 2024
1 parent 61aa88d commit 307a7cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/mlx5/mlx5_flow_dv.c
Original file line number Diff line number Diff line change
Expand Up @@ -5464,7 +5464,7 @@ flow_dv_modify_create_cb(void *tool_ctx, void *cb_ctx)
"cannot allocate resource memory");
return NULL;
}
rte_memcpy(&entry->ft_type,
rte_memcpy(RTE_PTR_ADD(entry, offsetof(typeof(*entry), ft_type)),
RTE_PTR_ADD(ref, offsetof(typeof(*ref), ft_type)),
key_len + data_len);
if (entry->ft_type == MLX5DV_FLOW_TABLE_TYPE_FDB)
Expand Down

0 comments on commit 307a7cc

Please sign in to comment.