diff --git a/include/spdk/util.h b/include/spdk/util.h index 8b52dc358..993d10ac1 100644 --- a/include/spdk/util.h +++ b/include/spdk/util.h @@ -44,6 +44,8 @@ extern "C" { #endif +#define SPDK_CACHE_LINE_SIZE 64 + #define spdk_min(a,b) (((a)<(b))?(a):(b)) #define spdk_max(a,b) (((a)>(b))?(a):(b)) diff --git a/lib/event/reactor.c b/lib/event/reactor.c index 3695c93e6..05adadb5b 100644 --- a/lib/event/reactor.c +++ b/lib/event/reactor.c @@ -81,7 +81,7 @@ struct spdk_reactor { /* The last known rusage values */ struct rusage rusage; -} __attribute__((aligned(64))); +} __attribute__((aligned(SPDK_CACHE_LINE_SIZE))); static struct spdk_reactor *g_reactors; static struct spdk_cpuset *g_reactor_core_mask; diff --git a/lib/vhost/vhost_internal.h b/lib/vhost/vhost_internal.h index 6d15249bb..c81409e55 100644 --- a/lib/vhost/vhost_internal.h +++ b/lib/vhost/vhost_internal.h @@ -42,11 +42,10 @@ #include "spdk_internal/vhost_user.h" #include "spdk_internal/log.h" #include "spdk/event.h" +#include "spdk/util.h" #include "spdk/rpc.h" #include "spdk/config.h" -#define SPDK_CACHE_LINE_SIZE RTE_CACHE_LINE_SIZE - #define SPDK_VHOST_MAX_VQUEUES 256 #define SPDK_VHOST_MAX_VQ_SIZE 1024