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 C310C43F7C; Thu, 9 May 2024 13:11:56 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4510D402D7; Thu, 9 May 2024 13:11:56 +0200 (CEST) Received: from mail-vs1-f41.google.com (mail-vs1-f41.google.com [209.85.217.41]) by mails.dpdk.org (Postfix) with ESMTP id AE2C0402B7 for ; Thu, 9 May 2024 13:11:54 +0200 (CEST) Received: by mail-vs1-f41.google.com with SMTP id ada2fe7eead31-47efc592d9fso240659137.0 for ; Thu, 09 May 2024 04:11:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1715253113; x=1715857913; 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=GChY4ymwrllgH6RTtIgghn+TGJ4h0h3D7IYks7rwAJc=; b=hulUnDm6sLcrb4Wdf/Fb6sz8EQlULxPu1Hkv/n5CDMIY8H9OsS4+crv6UElHDhaQ5s joGTvIP7b9wO0IDO2bX8OL8pv0FxHOyW2x6QHehtXVJc8ZrWo0eYhgg8ig//qdLJc4Ph J1Tu3Nd5D/1Ans2zOtHMzujIWb2XEwOXeRkI5DjAtE9GVDIxS//bOH3X+mKOIj5PJTOG 5uSa9wowP7AF3ZRT6M/UQi01a+0T9aRlcO2gzlnxXYmjRTe12I6v+Bvy2T1PPu32LqW+ UCQ9/Y23WRVQsAYZdGvRuSiL1c4H3i9Hjx9txhejAwRg98Gtxf1bJ/WHBIpT74/gkwYq bLvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715253114; x=1715857914; 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=GChY4ymwrllgH6RTtIgghn+TGJ4h0h3D7IYks7rwAJc=; b=dEq5hkTyl7PlJyadBsKUY1t8IPqxIbFD69PHDK7uqxwEoXWBQeIgIXkkfVs2vQ+bxr GRidRc8luLpxUf00DV3Z34Q7kR4/74qoFXRmkFPUpbXXUqErTkgoHJVN/F/osBPo539L YIXARM9dGZR0TGYcDIE3XEzhIjVL+FA9fjmQUMCLfndMPTv0LugXxIy17FC0kWQ0iVFz c5rrD0prXVxnxlxO8J/wFRZcGmX1KzmCKgfNYYV0SahymaM94AwgWEldRSJkpmW5WQzy yBANps1iWysYnjs+IfvZnfEi5FIwsJcaRlwdI6qcQxokhR99Jo6/76FxrKIyJbAZabsw 9MvQ== X-Forwarded-Encrypted: i=1; AJvYcCUja0vNJa1GMCxmIBfm03laYYRtzrflTU/RPGOUTgb0flviTUqTZG5/kIfCpGJtHKC0fRimVDP1qoGyEtY= X-Gm-Message-State: AOJu0YyB7v29TvHNsEdNq8xdSZYCRcFeJnirY+dod/FFlPFfusFgOSVE SpHf4kj6XojobvYiRhltBvNrmXsVXn9YTKccSIhv9oaIaNfWfeQj4c69Apl8IpA= X-Google-Smtp-Source: AGHT+IEm2iP1ldy0WrHrVYUs8hzfRNQX9vnzqZzSs8CrJe8gpqWsjWcHmIlOd6EoTI9/GQ82y6YyXg== X-Received: by 2002:a05:6102:5895:b0:47c:28c1:c434 with SMTP id ada2fe7eead31-47f3c3693e3mr4907741137.26.1715253113657; Thu, 09 May 2024 04:11:53 -0700 (PDT) Received: from ste-uk-lab-gw ([93.115.195.2]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-43df54d922esm6908461cf.22.2024.05.09.04.11.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 04:11:53 -0700 (PDT) Date: Thu, 9 May 2024 12:11:50 +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: <20240509111150.GA2730096@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> <20240503180236.3dd0ee2c@hermes.local> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240503180236.3dd0ee2c@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 Fri, May 03, 2024 at 06:02:36PM -0700, Stephen Hemminger wrote: > On Thu, 2 May 2024 15:21:16 +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. > > > > ../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 > > The only calls to rte_wait_until_equal_16 in upstream code > are in the test_bbdev_perf.c and test_timer.c. Looks like > these test never got fixed to use rte_memory_order instead of __ATOMIC_ defines. Apologies, the commit message could make it clearer, but this is also an issue for rte_wait_until_equal_32 and rte_wait_until_equal_64. rte_wait_until_equal_32 is used in a dozen or so lock tests with the old __ATOMIC_ defines, as well as rte_ring_generic_pvt.h and rte_ring_c11_pvt.h, where it's used with the new rte_memorder_order values. Correct me if I'm wrong, but shouldn't the static assertions in rte_stdatomic.h ensure that mixed usage doesn't cause any issues, even if using the older __ATOMIC_ defines isn't ideal? > And there should be a CI test for ARM that enables the WFE code at least > to ensure it works! Yes, that could've caught this sooner.