Skip to contentSkip to conversation

RDMA/irdma: fix irdma_alloc_ucontext_resp padding

PATCH Applied Arnd Bergmann 4 participants 5 messages Dec 8, 2025 – Dec 17, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RDMA/irdma: fix irdma_alloc_ucontext_resp padding

From: Arnd Bergmann <[email protected]>

A recent modified struct irdma_alloc_ucontext_resp by adding a member with implicit padding in front of it, changing the ABI in an incompatibible way on all architectures other than m68k, as reported by scripts/check-uapi.sh:

==== ABI differences detected in include/rdma/irdma-abi.h from 1dd7bde2e91c -> HEAD ====
[C] 'struct irdma_alloc_ucontext_resp' changed:
type size changed from 704 to 640 (in bits)
1 data member deletion:
'__u8 rsvd3[2]', at offset 640 (in bits) at irdma-abi.h:61:1
1 data member insertion:
'__u8 revd3[2]', at offset 592 (in bits) at irdma-abi.h:60:1

Change the ABI back to the previous version, by moving the new max_hw_srq_quanta member into a naturally aligned location.

Fixes 563e1feb5f6e ("RDMA/irdma: Add SRQ support")
---
 include/uapi/rdma/irdma-abi.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/uapi/rdma/irdma-abi.h +1 -1
index f7788d33376b..36f20802bcc8 100644
@@ -57,8 +57,8 @@ struct irdma_alloc_ucontext_resp {
 	__u8 rsvd2;
 	__aligned_u64 comp_mask;
 	__u16 min_hw_wq_size;
+	__u8 revd3[2];
 	__u32 max_hw_srq_quanta;
-	__u8 rsvd3[2];
 };
 
 struct irdma_alloc_pd_resp {
Signature · 1 line
2.39.5
Reviewed-by on v1 1/1
#1 lore raw

Hi Arnd,

Quoted 15 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

A recent modified struct irdma_alloc_ucontext_resp by adding a member with implicit padding in front of it, changing the ABI in an incompatibible way on all architectures other than m68k, as reported by scripts/check-uapi.sh:

==== ABI differences detected in include/rdma/irdma-abi.h from 1dd7bde2e91c -> HEAD ====
[C] 'struct irdma_alloc_ucontext_resp' changed:
type size changed from 704 to 640 (in bits)
1 data member deletion:
'__u8 rsvd3[2]', at offset 640 (in bits) at irdma-abi.h:61:1
1 data member insertion:
'__u8 revd3[2]', at offset 592 (in bits) at irdma-abi.h:60:1

Quoted 5 lines

Change the ABI back to the previous version, by moving the new max_hw_srq_quanta member into a naturally aligned location.

Fixes 563e1feb5f6e ("RDMA/irdma: Add SRQ support")

Thanks for the discussion in Tokyo!

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Tested-by
#2 lore raw

Hi,

This doesn't change the offset of max_hw_srq_quanta on my system, but I tested with a verbs provider built with the previous and new proposed change just in case,
and both worked.

Out of curiosity, what is the policy for increasing the size of these uverbs driver
response structures? I think the response gets silently truncated if the user provides a smaller buffer, so this shouldn't have broken any user applications using the old ABI IIUC.

Thanks!

Quoted 40 lines · Geert Uytterhoeven

Hi Arnd,

Quoted 15 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

A recent modified struct irdma_alloc_ucontext_resp by adding a member with implicit padding in front of it, changing the ABI in an incompatibible way on all architectures other than m68k, as reported by scripts/check-uapi.sh:

==== ABI differences detected in include/rdma/irdma-abi.h from 1dd7bde2e91c -> HEAD ====
[C] 'struct irdma_alloc_ucontext_resp' changed:
type size changed from 704 to 640 (in bits)
1 data member deletion:
'__u8 rsvd3[2]', at offset 640 (in bits) at irdma-abi.h:61:1
1 data member insertion:
'__u8 revd3[2]', at offset 592 (in bits) at irdma-abi.h:60:1

Quoted 5 lines

Change the ABI back to the previous version, by moving the new max_hw_srq_quanta member into a naturally aligned location.

Fixes 563e1feb5f6e ("RDMA/irdma: Add SRQ support")

Thanks for the discussion in Tokyo!

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#3 lore raw

Hi Jacob,

Quoted 4 lines · Jacob Moroni

This doesn't change the offset of max_hw_srq_quanta on my system, but I tested with a verbs provider built with the previous and new proposed change just in case,
and both worked.

It indeed doesn't change the offset of that field (except on m68k), but it should restore the size of the structure to what it was before.

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
maintainer Applied
#4 lore raw
In reply to Arnd Bergmann
Quoted 6 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

A recent modified struct irdma_alloc_ucontext_resp by adding a member with implicit padding in front of it, changing the ABI in an incompatibible way on all architectures other than m68k, as reported by scripts/check-uapi.sh:

The growth of the structure should be tolerated, that is how the ABI is expected to work, though this is wrong and should be fixed while we still can.

Applied to for-rc

Thanks,
Jason