Re: [PATCH][next] RDMA/rxe: Avoid -Wflex-array-member-not-at-end warnings
From: Zhu Yanjun
Date: Fri Dec 19 2025 - 02:00:22 EST
在 2025/12/18 21:48, Gustavo A. R. Silva 写道:
The struct rxe_recv_wqe is as below.
struct rxe_recv_wqe {
__aligned_u64 wr_id;
__u32 reserved;
__u32 padding;
struct rxe_dma_info dma;
Expand struct rxe_dma_info here.
Thanks. In struct rxe_dma_info, the struct is
struct rxe_sge {
__aligned_u64 addr;
__u32 length;
__u32 lkey;
};
But in your commit, struct ib_sge is used.
struct ib_sge {
u64 addr;
u32 length;
u32 lkey;
};
__aligned_u64 is a 64-bit integer with a guaranteed 8-byte alignment,
used to preserve ABI correctness across architectures and between
userspace and kernel, while u64 has architecture-dependent alignment.
I am not sure if we can treate "struct rxe_sge" as the same with "struct ib_sge".
Leon and Jason, please comment on it.
Yanjun.Zhu
};
But I can not find dma.sge in the above struct. Can you explain it?
To be honest, I read your original commit for several times, but I can not get it. Can you explain the MACRO TRAILING_OVERLAP? And how can it replace the following struct?
This is clearly explained in the changelog text. I think what you're
missing will be clear once you understand how nested structures
work. See my comment above.
-Gustavo