[RFC,0/6] core libs: remove VLA warnings

Message ID 20240418103314.40705-1-konstantin.v.ananyev@yandex.ru (mailing list archive)
Headers
Series core libs: remove VLA warnings |

Message

Konstantin Ananyev April 18, 2024, 10:33 a.m. UTC
  From: Konstantin Ananyev <konstantin.ananyev@huawei.com>

This RFC is submitted as part of ongoing VLA removal discussion:
https://patchwork.dpdk.org/project/dpdk/list/?series=31680
The main aim is to explore amount of code changes that would be required for that,
plus explore alternate approaches instead of simple replacing VLAs with alloca() calls.
It touches core libraries only:
always_enable = [
        'cmdline',
        'eal',
        'ethdev',
        'hash',
        'kvargs',
        'log',
        'mbuf',
        'mempool',
        'meter',
        'net',
        'pci',
        'rcu',
        'ring',
        'stack',
        'telemetry',
 ]
For just these libs, we have reaonably small number of VLA warnings:
        1 ../lib/eal/common
	2 ../lib/eal/linux
 	2 ../lib/rcu
	3 ../lib/hash
	4 ../lib/ethdev

The series addresses them one by one, on individual basis.
Disclaimer: this is just an RFC, so some approaches might be questionable
(eal_interrupts).
Others (rcu) shall be treated as API change, so can be applied only for 24.11.
The main goal here is to start discussion and find the best possible approach.

Just as FYI, below is the number of VLA warnings per module for all libs and drivers on my machine
for linux 'default' build with gcc:

      1 ../drivers/crypto/cnxk
      1 ../drivers/crypto/octeontx
      1 ../drivers/crypto/scheduler
      1 ../drivers/net/dpaa
      1 ../drivers/net/failsafe
      1 ../drivers/net/gve
      1 ../drivers/net/i40e
      1 ../drivers/net/ice
      1 ../drivers/net/netvsc
      1 ../drivers/net/sfc
      1 ../lib/eventdev
      1 ../lib/latencystats
      1 ../lib/power
      2 ../drivers/common/mlx5
      2 ../drivers/crypto/ccp
      2 ../drivers/crypto/openssl
      2 ../drivers/net/nfp
      2 ../drivers/net/octeontx
      2 ../drivers/net/softnic
      2 ../drivers/net/vdev_netvsc
      2 ../lib/acl
      2 ../lib/dispatcher
      2 ../lib/eal/linux
      2 ../lib/gro
      2 ../lib/pdump
      2 ../lib/rcu
      3 ../drivers/common/cnxk
      3 ../drivers/common/idpf
      3 ../drivers/crypto/qat
      3 ../drivers/event/dsw
      3 ../drivers/net/bnxt
      3 ../drivers/net/cxgbe
      3 ../drivers/net/ixgbe
      3 ../lib/hash
      3 ../lib/pdcp
      3 ../lib/table
      4 ../drivers/net/bonding
      4 ../drivers/net/cnxk
      4 ../drivers/net/hns3
      4 ../drivers/net/tap
      4 ../lib/ethdev
      5 ../drivers/event/opdl
      5 ../drivers/net/dpaa2
      5 ../drivers/vdpa/mlx5
      5 ../lib/member
      6 ../drivers/event/cnxk
      6 ../lib/bpf
      6 ../lib/vhost
      7 ../drivers/common/mlx5/linux
      8 ../drivers/net/virtio
     10 ../drivers/net/mlx4
     11 ../drivers/net/mlx5
     13 ../drivers/event/sw
     17 ../drivers/net/mlx5/linux
     22 ../lib/lpm
     61 ../lib/ipsec

Konstantin Ananyev (6):
  eal/linux: remove VLA warnings
  eal/common: remove VLA warnings
  ethdev: remove VLA warnings
  hash: remove VLA warnings
  hash/thash: remove VLA warnings
  rcu: remove VLA warnings

 lib/eal/common/eal_common_proc.c |   5 +-
 lib/eal/linux/eal_interrupts.c   |  59 ++++++++--
 lib/ethdev/rte_ethdev.c          | 183 +++++++++++++++++++------------
 lib/hash/rte_cuckoo_hash.c       |   4 +-
 lib/hash/rte_thash.c             |   2 +-
 lib/hash/rte_thash.h             |   8 ++
 lib/rcu/rte_rcu_qsbr.c           |   7 +-
 lib/rcu/rte_rcu_qsbr.h           |   5 +
 8 files changed, 188 insertions(+), 85 deletions(-)