[PATCH v2] net/mlx5: fix build with GCC 12 and ASan

Raslan Darawsheh rasland at nvidia.com
Thu Mar 23 12:01:02 CET 2023


Hi,

> -----Original Message-----
> From: David Marchand <david.marchand at redhat.com>
> Sent: Wednesday, March 22, 2023 7:06 PM
> To: dev at dpdk.org
> Cc: stable at dpdk.org; Matan Azrad <matan at nvidia.com>; Slava Ovsiienko
> <viacheslavo at nvidia.com>
> Subject: [PATCH v2] net/mlx5: fix build with GCC 12 and ASan
> 
> Building with gcc 12 and ASan raises this warning:
> 
> ../drivers/net/mlx5/mlx5_txpp.c: In function ‘mlx5_txpp_xstats_get_names’:
> ../drivers/net/mlx5/mlx5_txpp.c:1066:25: error: ‘strncpy’ specified bound
> 	64 equals destination size [-Werror=stringop-truncation]
>  1066 |                         strncpy(xstats_names[i + n_used].name,
>       |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>  1067 |                                 mlx5_txpp_stat_names[i],
>       |                                 ~~~~~~~~~~~~~~~~~~~~~~~~
>  1068 |                                 RTE_ETH_XSTATS_NAME_SIZE);
>       |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors
> 
> Prefer strlcpy for xstats.
> 
> Fixes: 3b025c0ca425 ("net/mlx5: provide send scheduling error statistics")
> Cc: stable at dpdk.org
> 
> Signed-off-by: David Marchand <david.marchand at redhat.com>
> ---
> Changes since v1:
> - updated mlx5_xstats_get_names too,
> 
> ---

Acked-by: Raslan Darawsheh <rasland at nvidia.com>

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh


More information about the stable mailing list