ring: introduce C11 memory model barrier option
authorJia He <jia.he@hxt-semitech.com>
Mon, 22 Jan 2018 04:41:28 +0000 (20:41 -0800)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 29 Jan 2018 15:10:20 +0000 (16:10 +0100)
commit39368ebfc6067d0c82d76bdf4298ff9b8d257f21
tree1660e5888f96846a9a557d63966726399cd93117
parentc9fb3c62896f4f918ab99b2e1ed2f6eff387c507
ring: introduce C11 memory model barrier option

This patch is to support C11 memory model barrier in librte_ring.

There are 2 barrier implementation options in librte_ring (suggested
by Jerin).
1. use rte_smp_rmb
2. use load_acquire/store_release(refer to [1]).
The reason why providing 2 options is the performance benchmark
difference in different arm machines, refer to [2].

CONFIG_RTE_RING_USE_C11_MEM_MODEL is provided, and by default it is "n"
on any architectures and only "y" on arm64 so far.

[1] https://github.com/freebsd/freebsd/blob/master/sys/sys/buf_ring.h#L170
[2] http://dpdk.org/ml/archives/dev/2017-October/080861.html

Suggested-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Jia He <jia.he@hxt-semitech.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Jianbo Liu <jianbo.liu@arm.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
config/common_armv8a_linuxapp
config/common_base
lib/librte_ring/Makefile
lib/librte_ring/rte_ring.h
lib/librte_ring/rte_ring_c11_mem.h [new file with mode: 0644]