[PATCH v6 10/20] net/ixgbe: remove use of VLAs

Burakov, Anatoly anatoly.burakov at intel.com
Mon Nov 11 10:16:26 CET 2024


On 09/11/2024 02:48, Andre Muezerie wrote:
> From: Konstantin Ananyev <konstantin.ananyev at huawei.com>
> 
> 1) ../drivers/net/ixgbe/ixgbe_ethdev.c:3556:46: warning:
>      variable length array used [-Wvla]
> 2) ../drivers/net/ixgbe/ixgbe_ethdev.c:3739:23: warning:
>      variable length array used [-Wvla]
> 3) ../drivers/net/ixgbe/ixgbe_rxtx_vec_common.h:17:24: warning:
>      variable length array used [-Wvla]
> 
> For first two cases: in fact ixgbe_xstats_calc_num() always returns
> constant value, so it should be safe to replace that function invocation
> just with a macro that performs same calculations.
> 
> For case #3: reassemble_packets() is invoked only by
> ixgbe_recv_scattered_burst_vec().
> And in turn, ixgbe_recv_scattered_burst_vec() operates only on fixed
> max amount of packets per call: RTE_IXGBE_MAX_RX_BURST.
> So, it should be safe to replace VLA with fixed size array.
> 
> Signed-off-by: Konstantin Ananyev <konstantin.ananyev at huawei.com>
> ---
Acked-by: Anatoly Burakov <anatoly.burakov at intel.com>

-- 
Thanks,
Anatoly


More information about the dev mailing list