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 881B343F69; Thu, 2 May 2024 16:22:08 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0FCFB402B2; Thu, 2 May 2024 16:22:08 +0200 (CEST) Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by mails.dpdk.org (Postfix) with ESMTP id 43F5B40299 for ; Thu, 2 May 2024 16:22:06 +0200 (CEST) Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-41b782405bbso48219845e9.1 for ; Thu, 02 May 2024 07:22:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1714659726; x=1715264526; darn=dpdk.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=joYaMtyx/EraF468MIeAT/phfNyE11LoenH8GP9ck6A=; b=CFIRcsp6h/HrneQPg7iZMSWXccca0nhBmVDdh5gyGZdGxB0YM7tjCo3UAjXz+Ttfbk ZnqVlsodUS1v8LJEogXrV8IfizVfGYBteU8N2d6U/cCLhWOcMcSzUwog1/BTy9xawQGk FKxZ0zcjwHBUpY+j2+6c7dqRtvH5MydZcd3S+rUgzXJwJAQHafVAXzFeOUPU1rx1t25x 6HIgc0MaTKZQjXnPSmWpYmstvysEzfe8NU5PmCegLTXZwOrjOeXpcLiseR8mQiyG8P7f BN7wsyqSkQDqSOmhmlyDbIns/axCWIgO1iLP3lAQQ8WDgK4+sJwQfdeGEtGnNVIPkA6e Haiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714659726; x=1715264526; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=joYaMtyx/EraF468MIeAT/phfNyE11LoenH8GP9ck6A=; b=rssuFBH41CgLVU1EuuQzPDfhSOi7H7clDfEos71kiJSOztVOuAwli/zwq5PY+fX23x m8H8hY3JgcmmqiRE6feK37jlTiF4L/T8tQjPzNRqQVVDUshz4BYVnFKRue35EgQAiJ0v p5rwxz1tOrRgTyaSgxDa/1pyTKOE1wEHZzEgFY263UwS9SYUkPLlHJKdLJd5jRdYfJ3I tHCW9xMacmgKSUxzz1Vb2Oq5gu8l5qvs9o+O/2GxDKz9hvjfKVyiZE88otVi1UdzdUyV tNtq7eIFgTPnAqmvmkAwdrQtMP+RgHwfJjOsaNgdWY857/Sf9r4yYnAsNfjZAkmCPGPj IcEA== X-Gm-Message-State: AOJu0Yz13g+JagMnSlHG7/SxCgnPT0CPqzcIRzBPk58zMWxfKWmlnEvk GPHYZA3eJKIchEulvNO5eyFMj4AjxZvsRs7PyWsq5FCdpts913HAkUsNzmRKfm4= X-Google-Smtp-Source: AGHT+IFZzrZ4zBVWKLn6q+OTsfOaRdmPKwFjE5jpF9F7vrSLQWRlyNwtLmISHO3rrEp1mOt2WZF/fw== X-Received: by 2002:a05:600c:358c:b0:41c:3e1:9dbd with SMTP id p12-20020a05600c358c00b0041c03e19dbdmr1437240wmq.40.1714659725701; Thu, 02 May 2024 07:22:05 -0700 (PDT) Received: from C02FF2N1MD6T.bytedance.net ([79.173.157.19]) by smtp.gmail.com with ESMTPSA id s7-20020a05600c384700b0041c12324eb6sm5904744wmr.22.2024.05.02.07.22.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 07:22:05 -0700 (PDT) From: Daniel Gregory To: Ruifeng Wang Cc: dev@dpdk.org, Punit Agrawal , Liang Ma , Daniel Gregory Subject: [PATCH] eal/arm: replace RTE_BUILD_BUG on non-constant Date: Thu, 2 May 2024 15:21:16 +0100 Message-Id: <20240502142116.63760-1-daniel.gregory@bytedance.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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. ../lib/eal/arm/include/rte_pause_64.h: In function ‘rte_wait_until_equal_16’: ../lib/eal/include/rte_common.h:530:56: error: expression in static assertion is not constant 530 | #define RTE_BUILD_BUG_ON(condition) do { static_assert(!(condition), #condition); } while (0) | ^~~~~~~~~~~~ ../lib/eal/arm/include/rte_pause_64.h:156:9: note: in expansion of macro ‘RTE_BUILD_BUG_ON’ 156 | RTE_BUILD_BUG_ON(memorder != rte_memory_order_acquire && | ^~~~~~~~~~~~~~~~ This has been the case since the switch to C11 assert (537caad2). Fix the compile errors by replacing the check with an RTE_ASSERT. Signed-off-by: Daniel Gregory --- lib/eal/arm/include/rte_pause_64.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/eal/arm/include/rte_pause_64.h b/lib/eal/arm/include/rte_pause_64.h index 5cb8b59056..98e10e91c4 100644 --- a/lib/eal/arm/include/rte_pause_64.h +++ b/lib/eal/arm/include/rte_pause_64.h @@ -11,6 +11,7 @@ extern "C" { #endif #include +#include #ifdef RTE_ARM_USE_WFE #define RTE_WAIT_UNTIL_EQUAL_ARCH_DEFINED @@ -153,7 +154,7 @@ rte_wait_until_equal_16(volatile uint16_t *addr, uint16_t expected, { uint16_t value; - RTE_BUILD_BUG_ON(memorder != rte_memory_order_acquire && + RTE_ASSERT(memorder != rte_memory_order_acquire && memorder != rte_memory_order_relaxed); __RTE_ARM_LOAD_EXC_16(addr, value, memorder) @@ -172,7 +173,7 @@ rte_wait_until_equal_32(volatile uint32_t *addr, uint32_t expected, { uint32_t value; - RTE_BUILD_BUG_ON(memorder != rte_memory_order_acquire && + RTE_ASSERT(memorder != rte_memory_order_acquire && memorder != rte_memory_order_relaxed); __RTE_ARM_LOAD_EXC_32(addr, value, memorder) @@ -191,7 +192,7 @@ rte_wait_until_equal_64(volatile uint64_t *addr, uint64_t expected, { uint64_t value; - RTE_BUILD_BUG_ON(memorder != rte_memory_order_acquire && + RTE_ASSERT(memorder != rte_memory_order_acquire && memorder != rte_memory_order_relaxed); __RTE_ARM_LOAD_EXC_64(addr, value, memorder) -- 2.39.2