c11 safe string handling support
[vpp.git] / src / vnet / devices / virtio / vhost_user_input.c
index 1a7a0c4..291d687 100644 (file)
@@ -101,7 +101,7 @@ vhost_user_rx_trace (vhost_trace_t * t,
   virtio_net_hdr_mrg_rxbuf_t *hdr;
   u32 hint = 0;
 
-  memset (t, 0, sizeof (*t));
+  clib_memset (t, 0, sizeof (*t));
   t->device_index = vui - vum->vhost_user_interfaces;
   t->qid = qid;
 
@@ -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)];