From patchwork Fri May 3 18:27:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Gregory X-Patchwork-Id: 139857 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CC4D243F37; Fri, 3 May 2024 20:27:40 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4D268402D4; Fri, 3 May 2024 20:27:40 +0200 (CEST) Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) by mails.dpdk.org (Postfix) with ESMTP id 10A5D402D0 for ; Fri, 3 May 2024 20:27:39 +0200 (CEST) Received: by mail-lj1-f178.google.com with SMTP id 38308e7fff4ca-2e10b6e2bacso41021131fa.0 for ; Fri, 03 May 2024 11:27:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1714760858; x=1715365658; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yDqB81b7jVd/MwmoVYGWontISmP64yGM4Fw9J1Fynxo=; b=Dh73xqc983sfpYcMhQRkGKQm0arlhTmWENBklTqy4KBhvY6LX/NT2HJlWd5uQ7cYvJ I9veNQp9fkBF06cur57KQNzCuBDtViNu3tXBdO1NUpLEFRcNdjRdzUSWoCmGaI/t4ra+ PBh5JUuajD03qfOrO2GwjL77PL5SoO+hZ52YJC/uss7QBic0x2vlGCKS03ysnZiWxyRX V0k6JqFNRoOEoRJMp5NK0fStR/7jl+UjWNpUy7w4rFctBwcjPmZT8uUtjirn7vxocnly lYjoYR3oU6LbCrfsdtK5qmlDGrYdBJEbUZJdJfS9GvjRL2EierjrjcZ/G8AccPTVDpOx 0ZPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714760858; x=1715365658; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yDqB81b7jVd/MwmoVYGWontISmP64yGM4Fw9J1Fynxo=; b=dSVzIy5QnDOwAOfPDF6oLXB9A/1bGPH4urKU+Ra9CMuDQzTVAniR7h/k0z7VO6OsS3 Tb5Jcu+pjFhRgZl3Mtn3qaM2UWvvsXqkHfcsRfVkiYuF/FGNJ2QF0+2V86eOq5RNSYUh 7vPMKlcePng/iQyqLWmLl5paQF5HfFyfP9NsaLUUiLpEzKomUCfNdeIewhiq5iaiRlRa ArP3nHX16deCWJJs4Z0JXU5XpQY7/I6W9MnikLM70O5596r82pFZK5V5h2YTg21hUWty aD34DjR5n7WQUuN6FefMHKSq5bOunxJeq4PT5KGvMukERpxR2WhkozTKd8s8ciQSn5ZN tuzg== X-Gm-Message-State: AOJu0Ywb/BZ903zycirgjr2x1w8cbt5k+9dtQO24FqctjpVKbGEMblm6 TFP+CVefMVfdRbUn5AFT/YBiQEdplGS0bvAySiH4J1rMoHVSm7TMgktCtUFQ7c8= X-Google-Smtp-Source: AGHT+IFhlxCik66SRoZFErJzubVnKWhB7l1dPpN6UfvKzSe+Ti5N/VHi/UpX+bshkJV4K2fvNGlwAQ== X-Received: by 2002:a2e:9310:0:b0:2e2:72a7:843c with SMTP id e16-20020a2e9310000000b002e272a7843cmr1228363ljh.36.1714760858349; Fri, 03 May 2024 11:27:38 -0700 (PDT) Received: from C02FF2N1MD6T.bytedance.net ([93.115.195.2]) by smtp.gmail.com with ESMTPSA id l8-20020a05600c4f0800b0041bfa349cadsm10190225wmq.16.2024.05.03.11.27.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 11:27:37 -0700 (PDT) From: Daniel Gregory To: Ruifeng Wang Cc: dev@dpdk.org, Punit Agrawal , Liang Ma , Daniel Gregory , feifei.wang2@arm.com Subject: [PATCH v2] eal/arm: replace RTE_BUILD_BUG on non-constant Date: Fri, 3 May 2024 19:27:30 +0100 Message-Id: <20240503182730.31693-1-daniel.gregory@bytedance.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20240502142116.63760-1-daniel.gregory@bytedance.com> References: <20240502142116.63760-1-daniel.gregory@bytedance.com> MIME-Version: 1.0 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 && | ^~~~~~~~~~~~~~~~ Fix the compile errors by replacing the check with an assert, like in the generic implementation (lib/eal/include/generic/rte_pause.h). Fixes: 875f350924b8 ("eal: add a new helper for wait until scheme") Signed-off-by: Daniel Gregory Signed-off-by: Daniel Gregory Acked-by: Wathsala Vithanage --- Cc: feifei.wang2@arm.com --- lib/eal/arm/include/rte_pause_64.h | 8 +++++--- 1 file changed, 5 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..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 +#include + #include #ifdef RTE_ARM_USE_WFE @@ -153,7 +155,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 && + assert(memorder != rte_memory_order_acquire && memorder != rte_memory_order_relaxed); __RTE_ARM_LOAD_EXC_16(addr, value, memorder) @@ -172,7 +174,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 && + assert(memorder != rte_memory_order_acquire && memorder != rte_memory_order_relaxed); __RTE_ARM_LOAD_EXC_32(addr, value, memorder) @@ -191,7 +193,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 && + assert(memorder != rte_memory_order_acquire && memorder != rte_memory_order_relaxed); __RTE_ARM_LOAD_EXC_64(addr, value, memorder)