RDMA/siw: work around clang stack size warning
authorArnd Bergmann <arnd@arndb.de>
Fri, 20 Jun 2025 11:43:28 +0000 (13:43 +0200)
committerLeon Romanovsky <leon@kernel.org>
Thu, 26 Jun 2025 09:19:56 +0000 (05:19 -0400)
commit12423d8e18f301c5707173c83f8fb8bf33ed7c67
tree92cec132f0f2456749b4a5776abeca42fb296b73
parentb61cc1891c040f72ee3038ef123d76fe874bd93a
RDMA/siw: work around clang stack size warning

clang inlines a lot of functions into siw_qp_sq_process(), with the
aggregate stack frame blowing the warning limit in some configurations:

drivers/infiniband/sw/siw/siw_qp_tx.c:1014:5: error: stack frame size (1544) exceeds limit (1280) in 'siw_qp_sq_process' [-Werror,-Wframe-larger-than]

The real problem here is the array of kvec structures in siw_tx_hdt that
makes up the majority of the consumed stack space.

Ideally there would be a way to avoid allocating the array on the
stack, but that would require a larger rework. Add a noinline_for_stack
annotation to avoid the warning for now, and make clang behave the same
way as gcc here. The combined stack usage is still similar, but is spread
over multiple functions now.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://patch.msgid.link/20250620114332.4072051-1-arnd@kernel.org
Reviewed-by: Zhu Yanjun <yanjun.zhu@linux.dev>
Acked-by: Bernard Metzler <bmt@zurich.ibm.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/sw/siw/siw_qp_tx.c