Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Use acquire/release ordering when accessing svm_fifo shared variable cursize
[vpp.git]
/
src
/
svm
/
svm_fifo.c
diff --git
a/src/svm/svm_fifo.c
b/src/svm/svm_fifo.c
index
fb942a6
..
4397ef8
100644
(file)
--- a/
src/svm/svm_fifo.c
+++ b/
src/svm/svm_fifo.c
@@
-519,7
+519,7
@@
CLIB_MARCH_FN (svm_fifo_enqueue_nowait, int, svm_fifo_t * f, u32 max_bytes,
/* Atomically increase the queue length */
ASSERT (cursize + total_copy_bytes <= nitems);
/* Atomically increase the queue length */
ASSERT (cursize + total_copy_bytes <= nitems);
- clib_atomic_fetch_add (&f->cursize, total_copy_bytes);
+ clib_atomic_fetch_add
_rel
(&f->cursize, total_copy_bytes);
return (total_copy_bytes);
}
return (total_copy_bytes);
}
@@
-666,7
+666,7
@@
CLIB_MARCH_FN (svm_fifo_dequeue_nowait, int, svm_fifo_t * f, u32 max_bytes,
ASSERT (f->head <= nitems);
ASSERT (cursize >= total_copy_bytes);
ASSERT (f->head <= nitems);
ASSERT (cursize >= total_copy_bytes);
- clib_atomic_fetch_sub (&f->cursize, total_copy_bytes);
+ clib_atomic_fetch_sub
_rel
(&f->cursize, total_copy_bytes);
return (total_copy_bytes);
}
return (total_copy_bytes);
}
@@
-764,7
+764,7
@@
svm_fifo_dequeue_drop (svm_fifo_t * f, u32 max_bytes)
ASSERT (f->head <= nitems);
ASSERT (cursize >= total_drop_bytes);
ASSERT (f->head <= nitems);
ASSERT (cursize >= total_drop_bytes);
- clib_atomic_fetch_sub (&f->cursize, total_drop_bytes);
+ clib_atomic_fetch_sub
_rel
(&f->cursize, total_drop_bytes);
return total_drop_bytes;
}
return total_drop_bytes;
}
@@
-773,7
+773,7
@@
void
svm_fifo_dequeue_drop_all (svm_fifo_t * f)
{
f->head = f->tail;
svm_fifo_dequeue_drop_all (svm_fifo_t * f)
{
f->head = f->tail;
- clib_atomic_fetch_sub (&f->cursize, f->cursize);
+ clib_atomic_fetch_sub
_rel
(&f->cursize, f->cursize);
}
int
}
int
@@
-820,7
+820,7
@@
svm_fifo_segments_free (svm_fifo_t * f, svm_fifo_segment_t * fs)
f->head = (f->head + fs[0].len) % f->nitems;
total_drop_bytes = fs[0].len;
}
f->head = (f->head + fs[0].len) % f->nitems;
total_drop_bytes = fs[0].len;
}
- clib_atomic_fetch_sub (&f->cursize, total_drop_bytes);
+ clib_atomic_fetch_sub
_rel
(&f->cursize, total_drop_bytes);
}
u32
}
u32