VPP-102: vHost reconnect to previously used sockets on VPP restart 32/1332/2
authorJohn Lo <loj@cisco.com>
Tue, 31 May 2016 19:42:40 +0000 (15:42 -0400)
committerDave Barach <openvpp@barachs.net>
Tue, 31 May 2016 23:32:09 +0000 (23:32 +0000)
Change-Id: Ida11bddb52268e0e8513b7b379eeed6103bd48f1
Signed-off-by: John Lo <loj@cisco.com>
vnet/vnet/devices/dpdk/vhost_user.c

index c82b37f..1f98613 100644 (file)
@@ -589,6 +589,14 @@ dpdk_vhost_user_set_vring_addr(u32 hw_if_index, u8 idx, u64 desc, \
     clib_warning("falied to set vring addr");
   }
 
+  if (vq->last_used_idx != vq->used->idx) {
+    clib_warning("last_used_idx (%u) and vq->used->idx (%u) mismatches; "
+                 "some packets maybe resent for Tx and dropped for Rx",
+                 vq->last_used_idx, vq->used->idx);
+      vq->last_used_idx     = vq->used->idx;
+      vq->last_used_idx_res = vq->used->idx;
+  }
+
   /*
    * Inform the guest that there is no need to inform (kick) the
    * host when it adds buffers. kick results in vmexit and will