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 5CA5243F6A; Thu, 2 May 2024 19:44:26 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D4DBF402B2; Thu, 2 May 2024 19:44:25 +0200 (CEST) Received: from mail-qk1-f171.google.com (mail-qk1-f171.google.com [209.85.222.171]) by mails.dpdk.org (Postfix) with ESMTP id BB60840299 for ; Thu, 2 May 2024 19:44:24 +0200 (CEST) Received: by mail-qk1-f171.google.com with SMTP id af79cd13be357-78edc49861aso609338285a.3 for ; Thu, 02 May 2024 10:44:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1714671864; x=1715276664; darn=dpdk.org; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=HgOyQtKlT3B/74pogL/vnV1dzfk2GP4oj6Qf+8Y3lso=; b=bXAHgOyP4YqcyRhAkKy+IqL4DY9CaBSaGfJWnP9v3TZumagaEqtu7wHEiSl7mtOOFq JjmIT6PofIp9o3LvhfvUimXQumgzGFb/+pvhAF2hON5dzZcZKkcdV/1ZjLsRKixGtr6U gN5qJJlLlGxTH5cxTLl+rYtg8auq0QwYZ1lNYSUXwCj9uGTiSIqGITuZMzYwz3i5wi0B Jzj+OELlGlSq08STanPYovGim1+w+hbIYGxJGxL0mvY6aq1dKHzN2RQ+cARgvQryezm7 mz3EiP1HwyX0onmud2QaFOmkyR+E5XdCyNgMm+WsmzRGWtbjyQu5dQ7SjaF1ivh7o0ed BMjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714671864; x=1715276664; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HgOyQtKlT3B/74pogL/vnV1dzfk2GP4oj6Qf+8Y3lso=; b=JZkEOatStgnyLUuRJ0rx0V3IvnsgiNxPsX9RruYE9j+tgXcQ3E76BeK4dVbQBb6dwN eB4HML+naCvQMY9M70TLjzvStMBPRfvnc0Wke5QNqUS0QZp0NL0bkPbhTCpMKjRuQMF5 fhvZhw3MuGReqvggM+eSGJ9qcehjmxSMLeQvnxvY4ImFD7jxv5MAfJo5Danspnt+v5B3 pc340boZshKzcBR01G2vYiEn5Futa7qqqhkFVwQtVsM+uuRKmO0+oah63IPmHQGmTXt9 80TxEYyuXBpgbBVvY8SvOdrHUNv2rwDPSZRSa0jq1w4nDLlQLSNYaQvbxGpgGZHILha+ 6axw== X-Forwarded-Encrypted: i=1; AJvYcCUOpSdxvKJHie6zecSLHSxPeIHlq11oSaALGqPuWxjb3SOjzWKtdrOByQI/2Mtex0k5WUK6sSZ4ypbGmgc= X-Gm-Message-State: AOJu0YzA6XDASYpkdwFedPipGO8694+Q1g1Fc9Fxedr6ap2ngHA2pAuh OFQboZhVB+zdplhYJ7ovY1oWXPodXpLfkioETeXiZ21FWFZkjhe4Bn8sKdU/4Mg= X-Google-Smtp-Source: AGHT+IGBKJWgxmcbUpfb467vDJJW2mxw6jpSrJFGyEv+sFCUQli4EJNZOB893AFQRtF++1+qq524lw== X-Received: by 2002:a05:620a:14b4:b0:790:edc9:161d with SMTP id x20-20020a05620a14b400b00790edc9161dmr287291qkj.32.1714671863974; Thu, 02 May 2024 10:44:23 -0700 (PDT) Received: from ste-uk-lab-gw ([93.115.195.2]) by smtp.gmail.com with ESMTPSA id f20-20020a05620a20d400b007905e4a1ae1sm529637qka.96.2024.05.02.10.44.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 10:44:23 -0700 (PDT) Date: Thu, 2 May 2024 18:44:20 +0100 From: Daniel Gregory To: Stephen Hemminger Cc: Ruifeng Wang , dev@dpdk.org, Punit Agrawal , Liang Ma Subject: Re: [PATCH] eal/arm: replace RTE_BUILD_BUG on non-constant Message-ID: <20240502174420.GA3883350@ste-uk-lab-gw> Mail-Followup-To: Stephen Hemminger , Ruifeng Wang , dev@dpdk.org, Punit Agrawal , Liang Ma References: <20240502142116.63760-1-daniel.gregory@bytedance.com> <20240502092045.02a426fe@hermes.local> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240502092045.02a426fe@hermes.local> User-Agent: Mutt/1.10.1 (2018-07-13) 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 Thu, May 02, 2024 at 09:20:45AM -0700, Stephen Hemminger wrote: > Why not: > diff --git a/lib/eal/arm/include/rte_pause_64.h b/lib/eal/arm/include/rte_pause_64.h > index 5cb8b59056..81987de771 100644 > --- a/lib/eal/arm/include/rte_pause_64.h > +++ b/lib/eal/arm/include/rte_pause_64.h > @@ -172,6 +172,8 @@ rte_wait_until_equal_32(volatile uint32_t *addr, uint32_t expected, > { > uint32_t value; > > + static_assert(__builtin_constant_p(memorder), "memory order is not a constant"); > + > RTE_BUILD_BUG_ON(memorder != rte_memory_order_acquire && > memorder != rte_memory_order_relaxed); > > @@ -191,6 +193,8 @@ rte_wait_until_equal_64(volatile uint64_t *addr, uint64_t expected, > { > uint64_t value; > > + static_assert(__builtin_constant_p(memorder), "memory order is not a constant"); > + > RTE_BUILD_BUG_ON(memorder != rte_memory_order_acquire && > memorder != rte_memory_order_relaxed); > What toolchain are you using? With your change I still get errors about the expression not being constant: In file included from ../lib/eal/arm/include/rte_pause.h:13, from ../lib/eal/include/generic/rte_spinlock.h:25, from ../lib/eal/arm/include/rte_spinlock.h:17, from ../lib/telemetry/telemetry.c:20: ../lib/eal/arm/include/rte_pause_64.h: In function ‘rte_wait_until_equal_16’: ../lib/eal/arm/include/rte_pause_64.h:156:23: error: expression in static assertion is not constant 156 | static_assert(__builtin_constant_p(memorder), "memory order is not a constant"); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ I'm cross-compiling with GCC v12.2 using the config/arm/arm64_armv8_linux_gcc cross-file, and enabling RTE_ARM_USE_WFE by uncommenting it in config/arm/meson.build and setting its value to true.