DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] atomic operations
@ 2021-07-03 11:29 Thomas Monjalon
  2021-07-03 17:30 ` Stephen Hemminger
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Thomas Monjalon @ 2021-07-03 11:29 UTC (permalink / raw)
  To: honnappa.nagarahalli, ruifeng.wang, Phil Yang
  Cc: bruce.richardson, konstantin.ananyev, dev, david.marchand,
	David Christensen

In the deprecation notices of DPDK 21.05, we can still read this:
"
* rte_atomicNN_xxx: These APIs do not take memory order parameter. This does
  not allow for writing optimized code for all the CPU architectures supported
  in DPDK. DPDK will adopt C11 atomic operations semantics and provide wrappers
  using C11 atomic built-ins. These wrappers must be used for patches that
  need to be merged in 20.08 onwards. This change will not introduce any
  performance degradation.

* rte_smp_*mb: These APIs provide full barrier functionality. However, many
  use cases do not require full barriers. To support such use cases, DPDK will
  adopt C11 barrier semantics and provide wrappers using C11 atomic built-ins.
  These wrappers must be used for patches that need to be merged in 20.08
  onwards. This change will not introduce any performance degradation.
"

Should we keep these notifications forever?

It is very difficult to find which wrapper to use.

This is the guide we have:
https://doc.dpdk.org/guides/prog_guide/writing_efficient_code.html#locks-and-atomic-operations
There are 2 blog posts:
https://www.dpdk.org/blog/2021/03/26/dpdk-adopts-the-c11-memory-model/
https://www.dpdk.org/blog/2021/06/09/reader-writer-concurrency/

Basically it says we should use "__atomic builtins" but there is example
for simple situations like counters, memory barriers, etc.
Please who could work on improving the documentation?



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-07-07 19:28 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-03 11:29 [dpdk-dev] atomic operations Thomas Monjalon
2021-07-03 17:30 ` Stephen Hemminger
2021-07-04  0:40   ` Thomas Monjalon
2021-07-04  0:37 ` Thomas Monjalon
2021-07-05  7:00   ` Ruifeng Wang
2021-07-05  7:30     ` Thomas Monjalon
2021-07-05  8:33       ` Ruifeng Wang
2021-07-05 16:20         ` Stephen Hemminger
2021-07-07 19:04 ` Honnappa Nagarahalli
2021-07-07 19:28   ` Thomas Monjalon

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 NNTP newsgroup(s).