DPDK-dev Archive mirror
 help / color / mirror / Atom feed
From: Tyler Retzlaff <roretzla@linux.microsoft.com>
To: Stephen Hemminger <stephen@networkplumber.org>,
	Ruifeng Wang <ruifeng.wang@arm.com>,
	dev@dpdk.org, Punit Agrawal <punit.agrawal@bytedance.com>,
	Liang Ma <liangma@bytedance.com>
Subject: Re: [PATCH] eal/arm: replace RTE_BUILD_BUG on non-constant
Date: Thu, 9 May 2024 09:47:12 -0700	[thread overview]
Message-ID: <20240509164712.GA2349@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> (raw)
In-Reply-To: <20240509111150.GA2730096@ste-uk-lab-gw>

On Thu, May 09, 2024 at 12:11:50PM +0100, Daniel Gregory wrote:
> On Fri, May 03, 2024 at 06:02:36PM -0700, Stephen Hemminger wrote:
> > On Thu,  2 May 2024 15:21:16 +0100
> > Daniel Gregory <daniel.gregory@bytedance.com> 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 <daniel.gregory@bytedance.com>
> > 
> > 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?

this is just informational.

the static assertions are intended to make sure there is alignment
between the value produced by the rte_memory_order and __ATOMIC_ constant
expressions. so you can expect that intermixing __ATOMIC_ and rte_memory_order
should work.

the older __ATOMIC_ are still used in tests because i just haven't had
time to finish conversion. i have a series up now that makes most of the
conversions, it is waiting for review.

>  
> > 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.

  reply	other threads:[~2024-05-09 16:47 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-02 14:21 [PATCH] eal/arm: replace RTE_BUILD_BUG on non-constant Daniel Gregory
2024-05-02 16:20 ` Stephen Hemminger
2024-05-02 17:44   ` Daniel Gregory
2024-05-02 18:27     ` Stephen Hemminger
2024-05-02 21:48     ` Stephen Hemminger
2024-05-03  9:46       ` Daniel Gregory
2024-05-04  0:56         ` Stephen Hemminger
2024-05-09 11:02           ` Daniel Gregory
2024-05-03 13:32 ` David Marchand
2024-05-03 14:21   ` Daniel Gregory
2024-05-03 18:27 ` [PATCH v2] " Daniel Gregory
2024-05-03 18:30   ` Daniel Gregory
2024-05-04  0:59   ` Stephen Hemminger
2024-05-06  9:30   ` Ruifeng Wang
2024-05-11 17:00   ` Wathsala Wathawana Vithanage
2024-05-04  1:02 ` [PATCH] " Stephen Hemminger
2024-05-09 11:11   ` Daniel Gregory
2024-05-09 16:47     ` Tyler Retzlaff [this message]
2024-05-11 16:48 ` Wathsala Wathawana Vithanage

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240509164712.GA2349@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net \
    --to=roretzla@linux.microsoft.com \
    --cc=dev@dpdk.org \
    --cc=liangma@bytedance.com \
    --cc=punit.agrawal@bytedance.com \
    --cc=ruifeng.wang@arm.com \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).