lib: fix whitespace
[dpdk.git] / lib / librte_vhost / vhost_rxtx.c
index ccfd82f..2da4a02 100644 (file)
@@ -38,7 +38,7 @@
 #include <rte_memcpy.h>
 #include <rte_virtio_net.h>
 
-#include "vhost-net-cdev.h"
+#include "vhost-net.h"
 
 #define MAX_PKT_BURST 32
 
@@ -178,9 +178,12 @@ 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->kickfd, 1);
+               eventfd_write((int)vq->callfd, 1);
        return count;
 }
 
@@ -505,9 +508,12 @@ 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->kickfd, 1);
+                       eventfd_write((int)vq->callfd, 1);
        }
 
        return count;
@@ -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");
-                       return entry_success;
+                       break;
                }
                seg_offset = 0;
                seg_avail = m->buf_len - RTE_PKTMBUF_HEADROOM;
@@ -725,6 +731,6 @@ rte_vhost_dequeue_burst(struct virtio_net *dev, uint16_t queue_id,
        vq->used->idx += entry_success;
        /* Kick guest if required. */
        if (!(vq->avail->flags & VRING_AVAIL_F_NO_INTERRUPT))
-               eventfd_write((int)vq->kickfd, 1);
+               eventfd_write((int)vq->callfd, 1);
        return entry_success;
 }