net/virtio-user: fix crash in server mode
authorZhiyong Yang <zhiyong.yang@intel.com>
Thu, 24 May 2018 15:51:01 +0000 (23:51 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 25 May 2018 15:07:40 +0000 (17:07 +0200)
commitf42deafa44524562efa3f0373bf27f6adef382f5
tree4ec7b340e1f4cac5be69dbaaac1b0b7e360fad49
parentc49a438fce90e8ab0c46439026c337ab5ffa32c7
net/virtio-user: fix crash in server mode

For virtio-user server mode, one use case comes across segmentation fault.
step 1: Launch vhost side as client firstly.
step 2: launch virtio-user side as server.

The cause is: after registering virtio_interrupt_handler into
eal-intr-thread, two threads (main thread and eal-intr-thread) have
sync issues, so add rxvq pointer checking in function virtio_notify_peers
to decide if the code can continue.

Fixes: bd8f50a45d0f ("net/virtio-user: support server mode")
Cc: stable@dpdk.org
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
drivers/net/virtio/virtio_ethdev.c