[PATCH] net/mlx5: fix the building with flexible array

Thomas Monjalon thomas at monjalon.net
Mon Oct 31 21:13:16 CET 2022


31/10/2022 19:24, Bing Zhao:
> With some higher GCC/CLANG version, it is not recommended to use a
> structure with a tailing flexible array inside another structure.
> Accessing this array may be considered as a risk to corrupt the
> following field even if it is by intention.
> 
> The error below was observed:
> 
>   drivers/net/mlx5/linux/mlx5_ethdev_os.c: In function 'mlx5_get_flag_dropless_rq':
>   drivers/net/mlx5/linux/mlx5_ethdev_os.c:1679:42: error: invalid use of structure with flexible array member [-Werror=pedantic]
>   1679 | struct ethtool_sset_info hdr;
>        | ^~~
> 
> Changing it to memory dynamic allocation method will help to get
> rid of this complain.
> 
> Fixes: e848218741ea ("net/mlx5: check delay drop settings in kernel driver")
> Cc: stable at dpdk.org
> 
> Signed-off-by: Bing Zhao <bingz at nvidia.com>

Acked-by: Thomas Monjalon <thomas at monjalon.net>

Applied, thanks.
For an unknown reason, our GitHub CI started to fail on Sunday
with Fedora 35. Looks like an update was done in Fedora 35.
Now it is fixed!




More information about the stable mailing list