aboutsummaryrefslogtreecommitdiffstats
path: root/examples/vhost/virtio_net.c
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@gmail.com>2017-07-03 15:13:28 +0100
committerLuca Boccassi <luca.boccassi@gmail.com>2017-07-03 15:14:25 +0100
commit5c594d59c6927b6374fa59e16da3830507300321 (patch)
tree17ec0a2158cf2460e8f2ea3a1cf86ce87164e138 /examples/vhost/virtio_net.c
parent155502af1a45fa9474d56d4389dcba4e1e2c9f6d (diff)
parentbf7567fd2a5b0b28ab724046143c24561d38d015 (diff)
Merge 17.05.1 into 17.05.x
Change-Id: I65fdca844ad178ec6e2c086d45b901df93b55e58 Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
Diffstat (limited to 'examples/vhost/virtio_net.c')
-rw-r--r--examples/vhost/virtio_net.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/vhost/virtio_net.c b/examples/vhost/virtio_net.c
index cc2c3d88..5e1ed44a 100644
--- a/examples/vhost/virtio_net.c
+++ b/examples/vhost/virtio_net.c
@@ -350,6 +350,9 @@ vs_dequeue_pkts(struct vhost_dev *dev, uint16_t queue_id,
count = RTE_MIN(count, MAX_PKT_BURST);
count = RTE_MIN(count, free_entries);
+ if (unlikely(count == 0))
+ return 0;
+
/*
* Retrieve all of the head indexes first and pre-update used entries
* to avoid caching issues.
@@ -385,8 +388,6 @@ vs_dequeue_pkts(struct vhost_dev *dev, uint16_t queue_id,
}
}
- if (!i)
- return 0;
queue->last_avail_idx += i;
queue->last_used_idx += i;