]> git.baikalelectronics.ru Git - kernel.git/commit
vhost: try avoiding avail index access when getting descriptor
authorJason Wang <jasowang@redhat.com>
Tue, 7 Feb 2017 07:49:50 +0000 (15:49 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 27 Feb 2017 18:37:27 +0000 (20:37 +0200)
commit61083d92ae836dd4d26f1328ed818ce8a0c479c2
tree45d602addb89b2cd3cf1617ecb85275dad7d3f9e
parent164cba8a3bf6f17484bdfe406214bfdc67a0d580
vhost: try avoiding avail index access when getting descriptor

If last avail idx is not equal to cached avail idx, we're sure there's
still available buffers in the virtqueue so there's no need to re-read
avail idx. So let's skip this to avoid unnecessary userspace memory
access and memory barrier. Pktgen test show about 3% improvement on rx
pps.

Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/vhost/vhost.c