aboutsummaryrefslogtreecommitdiffstats
path: root/src/svm/svm_fifo.h
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-03-21 13:54:53 -0700
committerFlorin Coras <fcoras@cisco.com>2019-03-21 13:56:02 -0700
commit4b76112dc43b775abd3deb2d9f65458ca08424ee (patch)
tree1251f033f1162b1ef24be81ed8d6f3d48d8ef1ed /src/svm/svm_fifo.h
parent192b13f96d6b4d1b4cbbb64a3d447329bf2ba900 (diff)
session/fifo: make event unset atomic
Ensures that fifo cursize loads cannot be speculated to before the event unset. Change-Id: Ia7c20c510d58f26a8e9b82d3982c6d4143a3a4d6 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/svm/svm_fifo.h')
-rw-r--r--src/svm/svm_fifo.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/svm/svm_fifo.h b/src/svm/svm_fifo.h
index d7146ae1fb0..6c3940dfad5 100644
--- a/src/svm/svm_fifo.h
+++ b/src/svm/svm_fifo.h
@@ -179,12 +179,12 @@ svm_fifo_set_event (svm_fifo_t * f)
/**
* Unsets fifo event flag.
*
- * Also acts as a release barrier.
+ * Also acts as an acquire barrier.
*/
always_inline void
svm_fifo_unset_event (svm_fifo_t * f)
{
- clib_atomic_release (&f->has_event);
+ __atomic_exchange_n (&f->has_event, 0, __ATOMIC_ACQUIRE);
}
svm_fifo_t *svm_fifo_create (u32 data_size_in_bytes);