vhost: predict map_guest_mem returns similar results over time 20/3020/6
authorPierre Pfister <ppfister@cisco.com>
Wed, 21 Sep 2016 07:08:55 +0000 (08:08 +0100)
committerDamjan Marion <dmarion.lists@gmail.com>
Mon, 3 Oct 2016 16:19:46 +0000 (16:19 +0000)
commit11f9205c10b9d7227b0f8bc2da283917bc653274
tree72c2bbe3636fe3c86ec0b375dcf0196d85279e4d
parent240977f2fb7c15d39b9640d1bfb6f10c3b1d1d9e
vhost: predict map_guest_mem returns similar results over time

It is very likely that all packets are being stored in the same
memory area.
It is also likely that all indirect descriptors are being
allocated from the same area.

This patch takes this into account by predicting the value
returned by map_guest_mem will be the same as the previous one.
It falls back to slow mode otherwise.

Change-Id: Ic1044a172fc4abe77387ba2e19e11cd1f39ad1e3
Signed-off-by: Pierre Pfister <ppfister@cisco.com>
vnet/vnet/devices/virtio/vhost-user.c