git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net/virtio: improve perf via one-way barrier on avail flag
[dpdk.git]
/
lib
/
librte_vhost
/
vhost.h
diff --git
a/lib/librte_vhost/vhost.h
b/lib/librte_vhost/vhost.h
index
5131a97
..
099a0d3
100644
(file)
--- a/
lib/librte_vhost/vhost.h
+++ b/
lib/librte_vhost/vhost.h
@@
-344,7
+344,7
@@
vq_is_packed(struct virtio_net *dev)
static inline bool
desc_is_avail(struct vring_packed_desc *desc, bool wrap_counter)
{
static inline bool
desc_is_avail(struct vring_packed_desc *desc, bool wrap_counter)
{
- uint16_t flags =
*((volatile uint16_t *) &desc->flags
);
+ uint16_t flags =
__atomic_load_n(&desc->flags, __ATOMIC_ACQUIRE
);
return wrap_counter == !!(flags & VRING_DESC_F_AVAIL) &&
wrap_counter != !!(flags & VRING_DESC_F_USED);
return wrap_counter == !!(flags & VRING_DESC_F_AVAIL) &&
wrap_counter != !!(flags & VRING_DESC_F_USED);