Subject: Re: [PATCH 1/1] net/mlx5/core: Allocate ttc_params on heap

From: Simon Horman <[email-masked]>
Date: Thu, 26 Feb 2026 18:15:51 +0000

On Thu, Feb 26, 2026 at 05:28:55PM +0800, Cheng-Yang Chou wrote:
> The ttc_params structure is too large to be allocated on the stack,
> triggering warnings for exceeding the 1024-byte frame size limit.
> Consuming excessive stack space risks causing stack overflows.
> 
> Allocate the structure dynamically to maintain safe stack boundaries.
> 
> Signed-off-by: Po-Ying Chiu <[email-masked]>
> Signed-off-by: Cheng-Yang Chou <[email-masked]>
> ---
>  .../net/ethernet/mellanox/mlx5/core/en_rep.c  | 15 +++++++++----
>  .../net/ethernet/mellanox/mlx5/core/en_tc.c   | 15 ++++++++++---
>  .../mellanox/mlx5/core/lag/port_sel.c         | 22 ++++++++++++++-----
>  3 files changed, 39 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
> index 6eec88fa6d10..8e3862f5b563 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
> @@ -966,27 +966,34 @@ static int mlx5e_create_rep_ttc_table(struct mlx5e_priv *priv)
>  {
>  	struct mlx5e_rep_priv *rpriv = priv->ppriv;
>  	struct mlx5_eswitch_rep *rep = rpriv->rep;
> -	struct ttc_params ttc_params = {};
> +	struct ttc_params *ttc_params;
>  	int err;
>  
> +	ttc_params = kzalloc(sizeof(*ttc_params), GFP_KERNEL);
> +        if (!ttc_params)
> +                return -ENOMEM;
> +

Please use tabs (8 characters wide) rather than spaces
for indentation throughout this patch.

-- 
pw-bot: changes-requested