summaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/virtio/vhost_user_input.c
diff options
context:
space:
mode:
authorYichen Wang <yicwang@cisco.com>2018-08-28 23:05:27 -0700
committerDamjan Marion <dmarion@me.com>2018-09-12 13:17:32 +0000
commit28812a0d938d5113787ed7a9ee4b210515c4168b (patch)
tree10f40ff5317b6ce2766486522a0bfd943bd53e47 /src/vnet/devices/virtio/vhost_user_input.c
parent79a05f547146e1eb972ec505e6605f604d3a3054 (diff)
vhost: Fix VPP crash when reloading VM with mixed-type ports [VPP-1406]
When VM is having mixed type of vhost-user and SRIOV ports, QEMU (RedHat v2.10) will not send disconnect signal to VPP, and just gives the new memory region directly. VPP is not able to handle new memory region mapping without disconnect signal first, which will result in a SEGV. The fix will handle the VM reboot scenario without explict disconnect signal from QEMU. The fix is to invalidate the avail, desc, and used pointers in the txvq when the new memory regions are received. This is because these pointers are not valid anymore with the new memory regions. In the input node, check to make sure the avail pointer is valid and punt if not. Change-Id: Ieb8b427b202f4442a58907dab1661d63a03650de Signed-off-by: Yichen Wang <yicwang@cisco.com>
Diffstat (limited to 'src/vnet/devices/virtio/vhost_user_input.c')
-rw-r--r--src/vnet/devices/virtio/vhost_user_input.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/vnet/devices/virtio/vhost_user_input.c b/src/vnet/devices/virtio/vhost_user_input.c
index 1a7a0c47150..26140484d2e 100644
--- a/src/vnet/devices/virtio/vhost_user_input.c
+++ b/src/vnet/devices/virtio/vhost_user_input.c
@@ -259,6 +259,10 @@ vhost_user_if_input (vlib_main_t * vm,
u16 thread_index = vm->thread_index;
u16 copy_len = 0;
+ /* The descriptor table is not ready yet */
+ if (PREDICT_FALSE (txvq->avail == 0))
+ return 0;
+
{
/* do we have pending interrupts ? */
vhost_user_vring_t *rxvq = &vui->vrings[VHOST_VRING_IDX_RX (qid)];