vhost: fix virtio freeze due to missed interrupt
authorHuawei Xie <huawei.xie@intel.com>
Wed, 29 Apr 2015 11:11:24 +0000 (19:11 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 13 May 2015 10:16:47 +0000 (12:16 +0200)
commit159793ac867be6020309f2909f8c47afbf52ed3f
treedb2ba337430ad399fee9c9098889ad16d774a9b1
parent3f313bef3467044d4caf4f0408b43beb78330592
vhost: fix virtio freeze due to missed interrupt

Update of used->idx and read of avail->flags could be reordered.
Memory fence should be used to ensure the order, otherwise guest could see
a stale used->idx value after it toggles the interrupt suppression flag.
After guest sets the interrupt suppression flag, it will check if there
is more buffer to process through used->idx. If it sees a stale value,
it will exit the processing while host won't send interrupt to guest.

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
Reviewed-by: Luke Gorrie <luke@snabb.co>
lib/librte_vhost/vhost_rxtx.c