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 5992543305; Sat, 11 Nov 2023 18:29:05 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D7AF5400D7; Sat, 11 Nov 2023 18:29:04 +0100 (CET) Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) by mails.dpdk.org (Postfix) with ESMTP id AFC614003C for ; Sat, 11 Nov 2023 18:29:03 +0100 (CET) Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-6bd32d1a040so3191852b3a.3 for ; Sat, 11 Nov 2023 09:29:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1699723742; x=1700328542; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=3ZM2EkHpgFsVPy9SMrS+7BBILo7SfWMchPC5P1foA+0=; b=DZ8FuvcEC31xlLnS544GmjXOGjGtaK88Eau8QFrY84e5ZPPCAuFDycO8Ms9q6JAnfd ZL9FMyFTZNDRVUaX8ZgFLvMNnYYy8JDFC8s2j9h+IybrR+zVxbrFDb5T6npPISqmWy5e ECWlL3Th1EWf6mq8eRHSU1wzM423KyuDsWQwST4HKCtD+4LKjoiFnAKJ6FOMY83G0jEE Iid/y/3SGwjyPY6lgerWcP/lmYl0EgJNUBi309OlYf/9wAI6kI9xGQRCPwmDpWh9Nitp ZlhKBk8bTdbu2Arx0c97vhrzIhcpSozQbajd/Qy1lOvJ3FYmh7VY2DTrrV+8rYL7+bb4 aDJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699723742; x=1700328542; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3ZM2EkHpgFsVPy9SMrS+7BBILo7SfWMchPC5P1foA+0=; b=BSaNrz1e81bgCcFZjrWvi3/Wmznvq0ypHz4WWNTufb4Xc7vPtAOb/cQDauhpljYvfY AIde4G7mzaz2ko+SyQt/+tWZVoKCCnL/ZgVkopzys5OMEqhbnXWzqBgun02SsDVv6U5o lctQNTsdF9KjVbwzOnEIRdKhs9xHWoHOPtsEEQdSonpPeGLVlSPZD60/TKbk/w1yyasX /OZQBfyx4v6JmH2K02GLNekNk8yQzIoh4ItMhoHezYzKCCGgz9C4QirVC5f45rS53X1h 44RnmNux4d4cCU3Cfq5kRB3Wt7sM9zK2wmKPOWR9VnRt4MzNniD6kXXh6AOVpVUJjtgM gvtQ== X-Gm-Message-State: AOJu0YyC+QwuQ0st8bdEBZ0OnIuu9z+2z3nylxN02oyLylK31wIuDrJ8 p5KZZuR1xj6/0SR7VelLj3BK9g== X-Google-Smtp-Source: AGHT+IFa4w8NqoU90AaG9SO/y4klrXbBypXj7043LM9URMS1SmEGVwaOux8++1TTnHf6bHLWBCYUpg== X-Received: by 2002:a17:90b:3b49:b0:27d:6dd:fb7d with SMTP id ot9-20020a17090b3b4900b0027d06ddfb7dmr2588821pjb.17.1699723742411; Sat, 11 Nov 2023 09:29:02 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id 2-20020a17090a0d4200b002801ca4fad2sm3744592pju.10.2023.11.11.09.29.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Nov 2023 09:29:02 -0800 (PST) Date: Sat, 11 Nov 2023 09:29:00 -0800 From: Stephen Hemminger To: Andrew Rybchenko Cc: dev@dpdk.org Subject: Re: BUILD bug hidden in SFC driver. Message-ID: <20231111092900.6fee0220@hermes.local> In-Reply-To: <20231111085634.5df512bf@hermes.local> References: <20231111085634.5df512bf@hermes.local> MIME-Version: 1.0 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 Sat, 11 Nov 2023 08:56:34 -0800 Stephen Hemminger wrote: > While examining the use of VLA in DPDK, ran into a bug in sfc driver. >=20 > If DPDK is built with -Wvla, then the RTE_BUILD_BUG_ON() macro won't work > as written. Experimenting with a better more portable version of that mac= ro > as: > #define RTE_BUILD_BUG_ON(e) _Static_assert(!(e), #e) Sending this as RFC also catches another driver with hidden failure. from ../drivers/event/opdl/opdl_ring.c:10: ./drivers/event/opdl/opdl_ring.c: In function =E2=80=98opdl_ring_create=E2= =80=99: ./lib/eal/include/rte_common.h:498:44: error: expression in static assertio= n is not constant #define RTE_BUILD_BUG_ON(e) _Static_assert(!(e), #e) ^~~~ ./drivers/event/opdl/opdl_ring.c:913:2: note: in expansion of macro =E2=80= =98RTE_BUILD_BUG_ON=E2=80=99 RTE_BUILD_BUG_ON(!rte_is_power_of_2(OPDL_DISCLAIMS_PER_LCORE));