]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
mlx5: work around high stack usage with gcc
authorArnd Bergmann <arnd@arndb.de>
Sat, 4 Jan 2020 21:51:44 +0000 (22:51 +0100)
committerPaolo Pisati <paolo.pisati@canonical.com>
Mon, 24 Feb 2020 15:19:51 +0000 (16:19 +0100)
commit0e2fc98f3d50d4ca0d0bfb2c10ca996d1bfb8346
tree0bb4d54dea95da2d621278e2f4bee7886f1f8635
parent05ad736d74e6ef1e844e6ad6e3fbb83b2908ffad
mlx5: work around high stack usage with gcc

BugLink: https://bugs.launchpad.net/bugs/1864488
[ Upstream commit 42ae1a5c76691928ed217c7e40269db27f5225e9 ]

In some configurations, gcc tries too hard to optimize this code:

drivers/net/ethernet/mellanox/mlx5/core/en_stats.c: In function 'mlx5e_grp_sw_update_stats':
drivers/net/ethernet/mellanox/mlx5/core/en_stats.c:302:1: error: the frame size of 1336 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]

As was stated in the bug report, the reason is that gcc runs into a corner
case in the register allocator that is rather hard to fix in a good way.

As there is an easy way to work around it, just add a comment and the
barrier that stops gcc from trying to overoptimize the function.

Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92657
Cc: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/net/ethernet/mellanox/mlx5/core/en_stats.c