Re: [PATCH] net: qed: reduce stack usage for TLV processing

From: Alexander Lobakin
Date: Fri Jun 20 2025 - 10:10:48 EST


From: Arnd Bergmann <arnd@xxxxxxxxxx>
Date: Fri, 20 Jun 2025 15:09:53 +0200

> From: Arnd Bergmann <arnd@xxxxxxxx>
>
> clang gets a bit confused by the code in the qed_mfw_process_tlv_req and
> ends up spilling registers to the stack hundreds of times. When sanitizers
> are enabled, this can end up blowing the stack warning limit:
>
> drivers/net/ethernet/qlogic/qed/qed_mng_tlv.c:1244:5: error: stack frame size (1824) exceeds limit (1280) in 'qed_mfw_process_tlv_req' [-Werror,-Wframe-larger-than]
>
> Apparently the problem is the complexity of qed_mfw_update_tlvs()
> after inlining, and marking the four main branches of that function
> as noinline_for_stack makes this problem completely go away, the stack
> usage goes down to 100 bytes.
>
> Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>

Reviewed-by: Alexander Lobakin <aleksander.lobakin@xxxxxxxxx>

Thanks,
Olek