]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit7a4d8c8ed18fc925a416d48b0eac292a7e955cee
tree309655f555642864cf4038e264e1a4ff96839b47
parentae0ac51c27b435e5f667d4290790343882e2a3a0
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