]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: qed: reduce stack usage for TLV processing
authorArnd Bergmann <arnd@arndb.de>
Fri, 20 Jun 2025 13:09:53 +0000 (15:09 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 23 Jun 2025 13:21:32 +0000 (14:21 +0100)
commit95b6759a81833d0e8c7456430186c2f6d174764e
treeb640b6a61c2ac1bf2b3eb3a89ceb88e2d8328b06
parentb993ea46b3b601915ceaaf3c802adf11e7d6bac6
net: qed: reduce stack usage for TLV processing

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@arndb.de>
Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qed/qed_mng_tlv.c