X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_vhost%2Fvhost.h;h=099a0d3f6b1d5cc91c7a50db4915dfa1cc37f34b;hb=6094557de086702961800fdb1159670231a9f218;hp=5131a97a39c527163cd3fc46fc03209c8cf69849;hpb=43840e9d699c52b1d225fb28b0ce6d76cdeb0580;p=dpdk.git diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h index 5131a97a39..099a0d3f6b 100644 --- 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) { - 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);