From patchwork Thu Apr 18 10:33:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konstantin Ananyev X-Patchwork-Id: 874 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4CE4E43E9F; Thu, 18 Apr 2024 12:33:30 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 33633402CC; Thu, 18 Apr 2024 12:33:30 +0200 (CEST) Received: from forward102b.mail.yandex.net (forward102b.mail.yandex.net [178.154.239.149]) by mails.dpdk.org (Postfix) with ESMTP id 4924440042 for ; Thu, 18 Apr 2024 12:33:28 +0200 (CEST) Received: from mail-nwsmtp-smtp-production-main-22.iva.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-22.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:7907:0:640:8f19:0]) by forward102b.mail.yandex.net (Yandex) with ESMTPS id 7F35B60A25; Thu, 18 Apr 2024 13:33:27 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-22.iva.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id GXCBSvCo7Ko0-degf69m6; Thu, 18 Apr 2024 13:33:26 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1713436406; bh=BjsHctgf0y0QVGMVOtafEOKihjgrWkKsJcvVvlP16O0=; h=Message-Id:Date:Cc:Subject:To:From; b=Crww4fNmSdigYJGIlxrzV89gyPxatqH+hDL5ca1ydN9djjgDSZgTdUGWpgx8vQRe4 kLkpyEiBxZ0l/kJPN5Kw8QOxvReKf2FRelsuZWVySRm1+wYOYKg2+TbwWui9h1vuC6 hCzeZZCVkrwZ3aZNuN+FJCvt1V8YhpaFRkG4gmYI= Authentication-Results: mail-nwsmtp-smtp-production-main-22.iva.yp-c.yandex.net; dkim=pass header.i=@yandex.ru From: Konstantin Ananyev To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@amd.com, andrew.rybchenko@oktetlabs.ru, yipeng1.wang@intel.com, sameh.gobriel@intel.com, bruce.richardson@intel.com, vladimir.medvedkin@intel.com, honnappa.nagarahalli@arm.com, roretzla@linux.microsoft.com, Konstantin Ananyev Subject: [RFC 0/6] core libs: remove VLA warnings Date: Thu, 18 Apr 2024 11:33:08 +0100 Message-Id: <20240418103314.40705-1-konstantin.v.ananyev@yandex.ru> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Konstantin Ananyev 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(-)