From 17a1f07e5795b31d1a5bd5461b55e75015fceae9 Mon Sep 17 00:00:00 2001 From: Dariusz Stojaczyk Date: Thu, 23 Nov 2017 14:40:39 +0100 Subject: [PATCH] rte_virtio: removed direct rte_smb_*mb calls Replaced them with spdk alternatives. While here, also clarified the documentation for virtio_*mb. Change-Id: Ia604e9abd8eadc18fa3ea1a782e29e7da6b3c162 Signed-off-by: Dariusz Stojaczyk Reviewed-on: https://review.gerrithub.io/385627 Reviewed-by: Jim Harris Reviewed-by: Daniel Verkamp Reviewed-by: Ben Walker Tested-by: SPDK Automated Test System --- lib/bdev/virtio/rte_virtio/virtio.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/lib/bdev/virtio/rte_virtio/virtio.c b/lib/bdev/virtio/rte_virtio/virtio.c index 126070b93..4acbdbadd 100644 --- a/lib/bdev/virtio/rte_virtio/virtio.c +++ b/lib/bdev/virtio/rte_virtio/virtio.c @@ -48,7 +48,6 @@ #include #include -#include #include #include #include @@ -56,16 +55,13 @@ #include "spdk/env.h" #include "spdk/barrier.h" -/* - * Per virtio_config.h in Linux. - * For virtio_pci on SMP, we don't need to order with respect to MMIO - * accesses through relaxed memory I/O windows, so smp_mb() et al are - * sufficient. - * +/* We use SMP memory barrier variants as all virtio_pci devices + * are purely virtual. All MMIO is executed on a CPU core, so + * there's no need to do full MMIO synchronization. */ -#define virtio_mb() rte_smp_mb() -#define virtio_rmb() rte_smp_rmb() -#define virtio_wmb() rte_smp_wmb() +#define virtio_mb() spdk_smp_mb() +#define virtio_rmb() spdk_smp_rmb() +#define virtio_wmb() spdk_smp_wmb() #include "virtio.h"