]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
qed: reduce maximum stack frame size
authorArnd Bergmann <arnd@arndb.de>
Mon, 22 Jul 2019 15:01:23 +0000 (17:01 +0200)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 14 Feb 2020 05:29:37 +0000 (00:29 -0500)
commite7339afa60affb951387afc698af5facbdc3726d
treebf3ac089c4fc682cf43619f9d33622c00c442e23
parente56a42936383a3cf65819700855e828a051e7b68
qed: reduce maximum stack frame size

BugLink: https://bugs.launchpad.net/bugs/1863019
[ Upstream commit 7c116e02a4a7575c8c62bfd2106e3e3ec8fb99dc ]

clang warns about an overly large stack frame in one function
when it decides to inline all __qed_get_vport_*() functions into
__qed_get_vport_stats():

drivers/net/ethernet/qlogic/qed/qed_l2.c:1889:13: error: stack frame size of 1128 bytes in function '_qed_get_vport_stats' [-Werror,-Wframe-larger-than=]

Use a noinline_for_stack annotation to prevent clang from inlining
these, which keeps the maximum stack usage at around half of that
in the worst case, similar to what we get with gcc.

Fixes: 86622ee75312 ("qed: Move statistics to L2 code")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/net/ethernet/qlogic/qed/qed_l2.c