lib: fix whitespace
[dpdk.git] / lib / librte_vhost / vhost_rxtx.c
index 510ffe8..2da4a02 100644 (file)
@@ -178,6 +178,9 @@ virtio_dev_rx(struct virtio_net *dev, uint16_t queue_id,
        *(volatile uint16_t *)&vq->used->idx += count;
        vq->last_used_idx = res_end_idx;
 
+       /* flush used->idx update before we read avail->flags. */
+       rte_mb();
+
        /* Kick the guest if necessary. */
        if (!(vq->avail->flags & VRING_AVAIL_F_NO_INTERRUPT))
                eventfd_write((int)vq->callfd, 1);
@@ -505,6 +508,9 @@ virtio_dev_merge_rx(struct virtio_net *dev, uint16_t queue_id,
                *(volatile uint16_t *)&vq->used->idx += entry_success;
                vq->last_used_idx = res_end_idx;
 
+               /* flush used->idx update before we read avail->flags. */
+               rte_mb();
+
                /* Kick the guest if necessary. */
                if (!(vq->avail->flags & VRING_AVAIL_F_NO_INTERRUPT))
                        eventfd_write((int)vq->callfd, 1);
@@ -609,7 +615,7 @@ rte_vhost_dequeue_burst(struct virtio_net *dev, uint16_t queue_id,
                if (unlikely(m == NULL)) {
                        RTE_LOG(ERR, VHOST_DATA,
                                "Failed to allocate memory for mbuf.\n");
-                       break;  
+                       break;
                }
                seg_offset = 0;
                seg_avail = m->buf_len - RTE_PKTMBUF_HEADROOM;