Skip to content

Commit

Permalink
lkl: save vm_notify in virtio
Browse files Browse the repository at this point in the history
virtio avail event is set to the end of the virtio ring. In
TCP_RR, whenever a packet is received, the avail idx is increamented and
a vm_notify is called.

This commit can save vm_notify until there is no available buffer in
vring.

No obvious diff in netperf numbers.

Signed-off-by: Yuan Liu <liuyuan@google.com>
  • Loading branch information
liuyuan10 committed Jul 7, 2016
1 parent 7881bd3 commit 579a9f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/lkl/lib/virtio.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,14 +207,14 @@ void virtio_process_queue(struct virtio_dev *dev, uint32_t qidx)
if (dev->ops->acquire_queue)
dev->ops->acquire_queue(dev, qidx);

virtio_set_avail_event(q, q->avail->idx);

while (q->last_avail_idx != le16toh(q->avail->idx)) {
/* Make sure following loads happens after loading q->avail->idx.
*/
__sync_synchronize();
if (virtio_process_one(dev, q, q->last_avail_idx) < 0)
break;
if (q->last_avail_idx == le16toh(q->avail->idx))
virtio_set_avail_event(q, q->avail->idx);
}

if (dev->ops->release_queue)
Expand Down

0 comments on commit 579a9f5

Please sign in to comment.