This is a follow-up to my previous patch: it turns out that a single mb() isn't sufficient as network loss could still be triggered under stress.
Patch 1 is repost of v1. The following two patches fix more races found by code inspection and comparison with vhost in kernel. After applying these patches, no more network loss was observed. Michael S. Tsirkin (3): virtio: add missing mb() on notification virtio: add missing mb() on enable notification virtio: order index/descriptor reads hw/virtio.c | 11 +++++++++++ qemu-barrier.h | 28 +++++++++++++++++++++++++--- 2 files changed, 36 insertions(+), 3 deletions(-) -- MST