summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGavin Hu <gavin.hu@arm.com>2019-03-13 00:58:53 +0800
committerThomas Monjalon <thomas@monjalon.net>2019-03-28 01:22:04 +0100
commit85cffb2eccd9edf89a9e28539206a79258a6e9d9 (patch)
tree3f94d55ff71f498f7c2dc393dffb0112ffa1c9ef /app
parent5cbd14b3e5f91819d4e1924a5118b32754e0d87e (diff)
downloaddpdk-next-eventdev-85cffb2eccd9edf89a9e28539206a79258a6e9d9.zip
dpdk-next-eventdev-85cffb2eccd9edf89a9e28539206a79258a6e9d9.tar.gz
dpdk-next-eventdev-85cffb2eccd9edf89a9e28539206a79258a6e9d9.tar.xz
ring: enforce reading tail before slots
In weak memory models, like arm64, reading the prod.tail may get reordered after reading the ring slots, which corrupts the ring and stale data is observed. This issue was reported by NXP on 8-A72 DPAA2 board. The problem is most likely caused by missing the acquire semantics when reading prod.tail (in SC dequeue) which makes it possible to read a stale value from the ring slots. For MP (and MC) case, rte_atomic32_cmpset() already provides the required ordering. For SP case, the control depependency between if-statement (which depends on the read of r->cons.tail) and the later stores to the ring slots make RMB unnecessary. About the control dependency, read more at: https://www.cl.cam.ac.uk/~pes20/ppc-supplemental/test7.pdf This patch is adding the required read barrier to prevent reading the ring slots get reordered before reading prod.tail for SC case. Fixes: c9fb3c62896f ("ring: move code in a new header file") Cc: stable@dpdk.org Signed-off-by: Gavin Hu <gavin.hu@arm.com> Reviewed-by: Ola Liljedahl <ola.liljedahl@arm.com> Tested-by: Nipun Gupta <nipun.gupta@nxp.com> Acked-by: Nipun Gupta <nipun.gupta@nxp.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Diffstat (limited to 'app')
0 files changed, 0 insertions, 0 deletions