]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit - drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
net/mlx5e: allocate 'indirection_rqt' buffer dynamically
authorArnd Bergmann <arnd@arndb.de>
Mon, 8 Mar 2021 15:32:57 +0000 (16:32 +0100)
committerSaeed Mahameed <saeedm@nvidia.com>
Fri, 12 Mar 2021 23:29:32 +0000 (15:29 -0800)
commit2119bda642c49c732409574ce699e4845e95df48
tree309655f555642864cf4038e264e1a4ff96839b47
parente16cf9d754b93b0cb715ebb981e57cae200c19c9
net/mlx5e: allocate 'indirection_rqt' buffer dynamically

Increasing the size of the indirection_rqt array from 128 to 256 bytes
pushed the stack usage of the mlx5e_hairpin_fill_rqt_rqns() function
over the warning limit when building with clang and CONFIG_KASAN:

drivers/net/ethernet/mellanox/mlx5/core/en_tc.c:970:1: error: stack frame size of 1180 bytes in function 'mlx5e_tc_add_nic_flow' [-Werror,-Wframe-larger-than=]

Using dynamic allocation here is safe because the caller does the
same, and it reduces the stack usage of the function to just a few
bytes.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c