X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=lib%2Flibrte_vhost%2Fvhost.h;fp=lib%2Flibrte_vhost%2Fvhost.h;h=552b9298d27ed4aa1f8297f33c17ad2e2b7d4880;hb=e2bea7436061ca2e7e14bfcfdc5870f2555c3965;hp=5218f1b12dcd6a419af11cbca9ea0b10ea41a24d;hpb=a4f0fa29488e582ab8b5ef9db475b3d26ded690c;p=deb_dpdk.git diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h index 5218f1b1..552b9298 100644 --- a/lib/librte_vhost/vhost.h +++ b/lib/librte_vhost/vhost.h @@ -393,8 +393,10 @@ vq_is_packed(struct virtio_net *dev) static inline bool desc_is_avail(struct vring_packed_desc *desc, bool wrap_counter) { - return wrap_counter == !!(desc->flags & VRING_DESC_F_AVAIL) && - wrap_counter != !!(desc->flags & VRING_DESC_F_USED); + uint16_t flags = *((volatile uint16_t *) &desc->flags); + + return wrap_counter == !!(flags & VRING_DESC_F_AVAIL) && + wrap_counter != !!(flags & VRING_DESC_F_USED); } #define VHOST_LOG_PAGE 4096