virtio_ring: support event idx feature
authorMichael S. Tsirkin <mst@redhat.com>
Thu, 19 May 2011 23:10:44 +0000 (02:10 +0300)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 30 May 2011 01:44:15 +0000 (11:14 +0930)
commita5c262c5fd83ece01bd649fb08416c501d4c59d7
tree295ddc61d59236b6521f5587e2e78ccb8da5d97a
parentbf7035bf20563a6cadcb9e870406e7b21daf5e30
virtio_ring: support event idx feature

Support for the new event idx feature:
1. When enabling interrupts, publish the current avail index
   value to the host to get interrupts on the next update.
2. Use the new avail_event feature to reduce the number
   of exits from the guest.

Simple test with the simulator:

[virtio]# time ./virtio_test
spurious wakeus: 0x7

real    0m0.169s
user    0m0.140s
sys     0m0.019s
[virtio]# time ./virtio_test --no-event-idx
spurious wakeus: 0x11

real    0m0.649s
user    0m0.295s
sys     0m0.335s

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
drivers/virtio/virtio_ring.c