Acked-by: Chengwen Feng <fengcheng...@huawei.com>
On 7/23/2025 9:31 PM, David Marchand wrote:
> Content (param[]) of received multiprocess messages are aligned with
> a 4 bytes constraint.
>
> Before patch:
> struct mp_msg_internal {
> int type; /* 0 4 */
> struct rte_mp_msg {
> char name[64]; /* 4 64 */
> /* --- cacheline 1 boundary (64 bytes) was 4 bytes ago --- */
> int len_param; /* 68 4 */
> int num_fds; /* 72 4 */
> /* typedef uint8_t -> __uint8_t */ unsigned char param[256]; /* 76 256 */
> /* --- cacheline 5 boundary (320 bytes) was 12 bytes ago --- */
> int fds[253]; /* 332 1012 */
> } msg; /* 4 1340 */
>
> /* size: 1344, cachelines: 21, members: 2 */
> };
>
> This results in many unaligned accesses for multiprocess malloc requests.
>
> Examples:
> ../lib/eal/common/malloc_mp.c:308:32: runtime error:
> member access within misaligned address 0x7f7b35df4684 for type
> 'const struct malloc_mp_req', which requires 8 byte alignment
>
> ../lib/eal/common/malloc_mp.c:158:9: runtime error:
> member access within misaligned address 0x7f36a535bb5c for type
> 'const struct malloc_mp_req', which requires 8 byte alignment
>
> ../lib/eal/common/malloc_mp.c:171:8: runtime error:
> member access within misaligned address 0x7f4ba65f296c for type
> 'struct malloc_mp_req', which requires 8 byte alignment
>
> Align param[] to 64 bits to avoid unaligned accesses on structures
> passed through this array in mp messages.
>
> Signed-off-by: David Marchand <david.march...@redhat.com>