lkml.org 
[lkml]   [2023]   [Jan]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] [v2] mlx5: reduce stack usage in mlx5_setup_tc
From


On 17/01/2023 23:01, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> Clang warns about excessive stack usage on 32-bit targets:
>
> drivers/net/ethernet/mellanox/mlx5/core/en_main.c:3597:12: error: stack frame size (1184) exceeds limit (1024) in 'mlx5e_setup_tc' [-Werror,-Wframe-larger-than]
> static int mlx5e_setup_tc(struct net_device *dev, enum tc_setup_type type,
>
> It turns out that both the mlx5e_setup_tc_mqprio_dcb() function and
> the mlx5e_safe_switch_params() function it calls have a copy of
> 'struct mlx5e_params' on the stack, and this structure is fairly
> large.
>
> Use dynamic allocation for the inner one.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> v2: simplify the patch
> ---
> .../net/ethernet/mellanox/mlx5/core/en_main.c | 17 +++++++++++------
> 1 file changed, 11 insertions(+), 6 deletions(-)
>

Thanks for your patch.
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>

\
 
 \ /
  Last update: 2023-03-26 23:45    [W:0.036 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site