From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7B33B460FB; Thu, 23 Jan 2025 12:59:07 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 242BD40269; Thu, 23 Jan 2025 12:59:07 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id B67D940263 for ; Thu, 23 Jan 2025 12:59:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1737633544; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=539FI+Vdze3HJ9FsWPvY0qiLOkJvySF3zgXNCOI+JD8=; b=i12vXFgPOnGzxhKjwLc1c115Zy90CluMdXrltS6q27wggUtiF+PSEYsf026rtOX0ceg5fp zeqJgKMfc6Vp+qc6lh58rPJ2TNRDi6J3uSCW5UdFmyL7epAHtCbKpo18kfxcodL4Dg/aIN d1KtueoOX3AwytPl7N/9rQouBQmP00I= Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-70-Q9VtDf7BPUKUaS9vepe41Q-1; Thu, 23 Jan 2025 06:59:02 -0500 X-MC-Unique: Q9VtDf7BPUKUaS9vepe41Q-1 X-Mimecast-MFC-AGG-ID: Q9VtDf7BPUKUaS9vepe41Q Received: by mail-lf1-f70.google.com with SMTP id 2adb3069b0e04-5426f59d5c0so496713e87.2 for ; Thu, 23 Jan 2025 03:59:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737633541; x=1738238341; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=539FI+Vdze3HJ9FsWPvY0qiLOkJvySF3zgXNCOI+JD8=; b=A03rQ6nPA9ePgJDVMynGevEwok8FcBZB5gRVanG5bbDqoekfBpsAuHRUcWVlfSsr8M 6EUmF/N+UljTZib9wZBg2k+UWEEvg2CDRjw65ORHGoAX5gLQjwxFh26/863D2w3Yc4pF ZF8UWsHncot8p+Yg648Zwit8qhrZK86rsNjiw4InE4HC7WcXXU68wOdIvTeWBw24Kh0R yaXQNUs6MMRZVXag5jWfavhk1inJwFtUfB5RwD2gUPUQE+W9egSKLhMgwCuxvs8B95wO qVw+8NOwUpNQCSM/qVmmfwHE8ELFCqSqMRTl7wrW0Ng897ZLLvYPfALTV/7OWv3L5fSl ALhQ== X-Gm-Message-State: AOJu0YzSzu+G/5adNhEOpIxqoJ4Vk2AAGzIImzhJHpNLK9ovEqzFiAy/ GNOvSnPSLkEQ296v/YCAY6DHSG3+AgYYTSy1jfnX7jZw0KhiXnuQu9ZvPkPyyKsmj+FOiuUscPB M8dFTNvoQKoXEDt8yV2waaG3w2MzVOHQrdKI4+CKmDzHKr1692QnUf3Z3rMbWRJexw7bSgwozCP c90R6HvCZK7CjR4eU= X-Gm-Gg: ASbGncuUzQu19hRHi62pHqPFvruA29MmDxZ4Vj64Eilt7x14CDCiqea3uXAJdHdiA0R LLJgUJuV/7Th8zPNM2i6MDhBUDB7+Lz7evxnuNvsC+dVmvue9wR5skg== X-Received: by 2002:a05:6512:691:b0:541:cdef:7ca3 with SMTP id 2adb3069b0e04-5439c244ee7mr9400908e87.27.1737633541180; Thu, 23 Jan 2025 03:59:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IHyoaDC0S+ihAneNC6wpL9gAI/oHIACsQ7sn0oJDBXmCBgSxsPzY8efZsdhnR56S+J3olb1LSAKoWE2CBPuOoQ= X-Received: by 2002:a05:6512:691:b0:541:cdef:7ca3 with SMTP id 2adb3069b0e04-5439c244ee7mr9400899e87.27.1737633540737; Thu, 23 Jan 2025 03:59:00 -0800 (PST) MIME-Version: 1.0 References: <1713397319-26135-1-git-send-email-roretzla@linux.microsoft.com> <1736821958-3295-1-git-send-email-andremue@linux.microsoft.com> In-Reply-To: <1736821958-3295-1-git-send-email-andremue@linux.microsoft.com> From: David Marchand Date: Thu, 23 Jan 2025 12:58:49 +0100 X-Gm-Features: AbW1kvbJBHlxsqUXCxninq9NJRdzndonG6jvOmd0z5GXa32ZX8cYotCif7VRTws Message-ID: Subject: Re: [PATCH v16 00/60] remove use of VLAs for Windows To: Andre Muezerie Cc: dev@dpdk.org, konstantin.ananyev@huawei.com, thomas@monjalon.net X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: MzWzFaYmumQ5xiwaH6-l2Mtw9KaVJ8tXa6mFgnBLB2c_1737633541 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 On Tue, Jan 14, 2025 at 3:32=E2=80=AFAM Andre Muezerie wrote: > > As per guidance technical board meeting 2024/04/17. This series > removes the use of VLAs from code built for Windows for all 3 > toolchains. If there are additional opportunities to convert VLAs > to regular C arrays please provide the details for incorporation > into the series. > > MSVC does not support VLAs, replace VLAs with standard C arrays > or alloca(). alloca() is available for all toolchain/platform > combinations officially supported by DPDK. > > v16: > * remove -Wvla from drivers/common/mlx5/meson.build and > drivers/common/qat/meson.build > > v15: > * inverted some of the logic added during v14: > add -Wvla to meson build files in app and lib directories, adding > -Wno-vla to the few subdirectories which are not yet VLA free > > v14: > * add -Wvla to meson build for directories that are VLA free > under app, lib, drivers. This is to ensure that new VLAs are > not added to these directories in the future. Thanks for working on this topic. I see there is some back and forth on the topic of passing -Wvla. It would be less fragile to put a -Wla in a upper level meson.build (like config/meson.build for example), then disable explicitly in the parts that are not ready. Something like: diff --git a/config/meson.build b/config/meson.build index 6aaad6d8a4..be603bd45b 100644 --- a/config/meson.build +++ b/config/meson.build @@ -348,6 +348,17 @@ foreach arg: warning_flags endif endforeach +if cc.has_argument('-Wvla') + add_project_arguments('-Wvla', language: 'c') + if not is_windows + no_vla_cflag =3D '-Wno-vla' + else + no_vla_cflag =3D [] + endif +else + no_vla_cflag =3D [] +endif + # set other values pulled from the build options dpdk_conf.set('RTE_MAX_ETHPORTS', get_option('max_ethports')) dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet')) This has the benefit of avoiding repeating those if cc.has_argument() loops in all meson.build. Disabling becomes simply a matter of adding cflags +=3D no_vla_cflag. This also enforces -Wvla for code that is built on windows (with mingw buil= d). I had a try, and flagged all remaining components that have VLA in them. You can have a look at: https://github.com/david-marchand/dpdk/commit/vla_v16_dma This helped me catch a new VLA in the recently merged soring test code: https://github.com/david-marchand/dpdk/commit/vla_v16_dma~1 WDYT? --=20 David Marchand