vhost-user: restart vpp may cause vhost to crash 54/18254/1
authorSteven Luong <sluong@cisco.com>
Wed, 13 Mar 2019 04:35:42 +0000 (21:35 -0700)
committersteven luong <sluong@cisco.com>
Wed, 13 Mar 2019 14:11:53 +0000 (14:11 +0000)
Fix a typo in vhost_user_rx_discard_packet which may cause
txvq->last_avail_idx to go wild.

Change-Id: Ifaeb58835dff9b7ea82c061442722f1dcaa5d9a4
Signed-off-by: Steven Luong <sluong@cisco.com>
(cherry picked from commit 39382976701926c1f34191c1311829c15a53cb01)

src/vnet/devices/virtio/vhost_user_input.c

index d7f628c..79c66ee 100644 (file)
@@ -200,7 +200,7 @@ vhost_user_rx_discard_packet (vlib_main_t * vm,
   u16 last_used_idx = txvq->last_used_idx;
   while (discarded_packets != discard_max)
     {
-      if (avail_idx == txvq->last_avail_idx)
+      if (avail_idx == last_avail_idx)
        goto out;
 
       u16 desc_chain_head = txvq->avail->ring[last_avail_idx & mask];