barrier/x86: use lock+add for smp_mb() instead of mfence

This follows smp_mb() implementation in the latest DPDK.

Change-Id: I39f9259a0208579034e5ff39961a2c4b8b72975c
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/444041
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Darek Stojaczyk 2019-02-11 09:25:21 +01:00 committed by Jim Harris
parent 1168d86057
commit e8ccc71e83

View File

@ -113,8 +113,10 @@ extern "C" {
#define spdk_smp_mb() spdk_mb()
#elif defined(__aarch64__)
#define spdk_smp_mb() __asm volatile("dmb ish" ::: "memory")
#elif defined(__i386__) || defined(__x86_64__)
#define spdk_smp_mb() spdk_mb()
#elif defined(__x86_64__)
#define spdk_smp_mb() __asm volatile("lock addl $0, -128(%%rsp); " ::: "memory");
#elif defined(__i386__)
#define spdk_smp_mb() __asm volatile("lock addl $0, -128(%%esp); " ::: "memory");
#else
#define spdk_smp_mb()
#error Unknown architecture