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 71AEA45A7C; Fri, 4 Oct 2024 19:47:28 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DE62642F99; Fri, 4 Oct 2024 19:47:10 +0200 (CEST) Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) by mails.dpdk.org (Postfix) with ESMTP id 5FB0342F3F for ; Fri, 4 Oct 2024 19:47:09 +0200 (CEST) Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-20b7eb9e81eso28505045ad.2 for ; Fri, 04 Oct 2024 10:47:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1728064028; x=1728668828; 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=eM/LKZpNtMpi4Il75fCCBNw34UcLCDB+ljCOMKRPhzs=; b=qbkrGLOhmVL516xQesIyW2iLBDxRNWjMmbnsFG6mQnuPG2HXJh6/OfCl03Uo9TZmGw k/kQdzML60OxU2WdlEU4KwhS7mrDaF4IyxdDIPguQH+NEn1vmJMSBMOBH2ltQUR5YDnH L8iBAmXQe2gDA8rPSzc5QUEQwsa1bA8fWeC9J3oT8ChnGu+PqGMvdU64q9AqkO6y+mmJ W7jfwC20BzNGF9Uz6br40U5xtVa3the1JnnZcKk5WbT2IIelvb7l5wqWGkKFaeGJW+6M na97XB1sIIRpSedBCSsVg3iPKQC9FL+swi07dC2iTh+gyvygQfFW4DfH3Ac2kywvWTTU CFkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728064028; x=1728668828; 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=eM/LKZpNtMpi4Il75fCCBNw34UcLCDB+ljCOMKRPhzs=; b=UpvU74Ea49qpIAh1f13v/wJXRN4islrqoS+hWnu5yxguraVFWQUWnIiRqfauBYvodn AJ8wYWCxjb4W9II0x7sRdx8jcXwfbnxUctdA0nAuimvHensieYg1NOxysw2INF6G54GJ kVkr3V2AsGVKC3obI7gnIBTdq4RV38yzxkZbCZtiXYI+BYHMPh50QuSYIfH+C7EZMUPh QCN+kZqXyFB1CgYyUT8J3C7y0leWUzQcDYvNVnPNqQXqqMTTuf8OtQyWPSwFsfK7E682 KnROkgN99uUB1xEkLHM7v9GGLsqwJ384+QFq+5XkcVH/CTcVdYz4xaT/7qUhssEUfDyh g7Aw== X-Forwarded-Encrypted: i=1; AJvYcCW77EUqe4N3tXFQzv+LERmhnC12FzelJSPyT4WbdQrLBLuii2tYkdw9W+gTAFpk7ZFDIuQ=@dpdk.org X-Gm-Message-State: AOJu0YziFNxigyId0ScZap5iQuCjC0ZxjKgtZGU/+MavaYoykn7Q/dJM zB3Ei0S0ZGhmKZAlfNhEjkEXiku0qhS18qIfSJOFGxiMHmgW0We9JJK/zfvJsxxdqtOe2lRcLnX Q9bZIcQ== X-Google-Smtp-Source: AGHT+IFmoVWl82YhLXAd5SxmrTskHly0q9wpOfZbVH1rQz3+QdHxV8EQmstswz24bDUmXktkAM4wTw== X-Received: by 2002:a17:902:e2d4:b0:20b:b079:5b7a with SMTP id d9443c01a7336-20bff03519fmr31130255ad.50.1728064028581; Fri, 04 Oct 2024 10:47:08 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20c13930b9fsm1143835ad.123.2024.10.04.10.47.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Oct 2024 10:47:08 -0700 (PDT) Date: Fri, 4 Oct 2024 10:47:06 -0700 From: Stephen Hemminger To: Daniel Gregory Cc: Ruifeng Wang , dev@dpdk.org, Punit Agrawal , Liang Ma , feifei.wang2@arm.com Subject: Re: [PATCH v2] eal/arm: replace RTE_BUILD_BUG on non-constant Message-ID: <20241004104706.35a8ebf0@hermes.local> In-Reply-To: <20240503182730.31693-1-daniel.gregory@bytedance.com> References: <20240502142116.63760-1-daniel.gregory@bytedance.com> <20240503182730.31693-1-daniel.gregory@bytedance.com> 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 Fri, 3 May 2024 19:27:30 +0100 Daniel Gregory wrote: > The ARM implementation of rte_pause uses RTE_BUILD_BUG_ON to check > memorder, which is not constant. This causes compile errors when it is > enabled with RTE_ARM_USE_WFE. eg. >=20 > ../lib/eal/arm/include/rte_pause_64.h: In function =E2=80=98rte_wait_unti= l_equal_16=E2=80=99: > ../lib/eal/include/rte_common.h:530:56: error: expression in static asser= tion is not constant > 530 | #define RTE_BUILD_BUG_ON(condition) do { static_assert(!(conditio= n), #condition); } while (0) > | ^~~~~~~~~~= ~~ > ../lib/eal/arm/include/rte_pause_64.h:156:9: note: in expansion of macro = =E2=80=98RTE_BUILD_BUG_ON=E2=80=99 > 156 | RTE_BUILD_BUG_ON(memorder !=3D rte_memory_order_acquire && > | ^~~~~~~~~~~~~~~~ >=20 > Fix the compile errors by replacing the check with an assert, like in > the generic implementation (lib/eal/include/generic/rte_pause.h). >=20 > Fixes: 875f350924b8 ("eal: add a new helper for wait until scheme") >=20 > Signed-off-by: Daniel Gregory > --- > Cc: feifei.wang2@arm.com > --- > lib/eal/arm/include/rte_pause_64.h | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) >=20 > diff --git a/lib/eal/arm/include/rte_pause_64.h b/lib/eal/arm/include/rte= _pause_64.h > index 5cb8b59056..852660091a 100644 > --- a/lib/eal/arm/include/rte_pause_64.h > +++ b/lib/eal/arm/include/rte_pause_64.h > @@ -10,6 +10,8 @@ > extern "C" { > #endif > =20 > +#include > + > #include > =20 > #ifdef RTE_ARM_USE_WFE > @@ -153,7 +155,7 @@ rte_wait_until_equal_16(volatile uint16_t *addr, uint= 16_t expected, > { > uint16_t value; > =20 > - RTE_BUILD_BUG_ON(memorder !=3D rte_memory_order_acquire && > + assert(memorder !=3D rte_memory_order_acquire && > memorder !=3D rte_memory_order_relaxed); > =20 Why not change RET_BUILD_BUG_ON() to RTE_ASSERT()? The one issue is that by default RTE_ENABLE_ASSERT is not enabled.