[PATCH] eal: add notes to SMP memory barrier APIs

Ruifeng Wang Ruifeng.Wang at arm.com
Sun Jun 25 09:55:25 CEST 2023


> -----Original Message-----
> From: Thomas Monjalon <thomas at monjalon.net>
> Sent: Wednesday, June 21, 2023 3:30 PM
> To: Ruifeng Wang <Ruifeng.Wang at arm.com>
> Cc: david.marchand at redhat.com; dev at dpdk.org; konstantin.v.ananyev at yandex.ru; Honnappa
> Nagarahalli <Honnappa.Nagarahalli at arm.com>; nd <nd at arm.com>
> Subject: Re: [PATCH] eal: add notes to SMP memory barrier APIs
> 
> 21/06/2023 08:44, Ruifeng Wang:
> > + * @note
> > + *  This function is deprecated. It adds complexity to the memory
> > + model
> > + *  used by this project. C11 memory model should always be used.
> > + *  rte_atomic_thread_fence() should be used instead.
> >   */
> >  static inline void rte_smp_mb(void);
> 
> I think it should be more explicit:
> "the memory model used by this project" -> the DPDK memory model Why it adds complexity?

The rte_smp_xx APIs define a set of memory order semantics. It is redundant given we are
using memory order semantics defined in the C language.
I'll make it more explicit in the next version.

> What do you mean by "C11 memory model"?

I mean the memory order semantics:
https://en.cppreference.com/w/c/atomic/memory_order

> 



More information about the dev mailing list