vhost-user: fix missing speculative enqueue unwind 21/5021/3
authorSteven <sluong@cisco.com>
Fri, 3 Feb 2017 17:30:37 +0000 (09:30 -0800)
committerDamjan Marion <dmarion.lists@gmail.com>
Fri, 3 Feb 2017 18:57:50 +0000 (18:57 +0000)
Running trex in a VM with a bad config, trex sent a bogus pack from
the VM to the Virtual interface. It caused a crash.

Change-Id: I64d0197b444265553ab4c24f21e6a962e89cb587
Signed-off-by: Steven <sluong@cisco.com>
src/vnet/devices/virtio/vhost-user.c

index ac14286..9b8c188 100644 (file)
@@ -1677,6 +1677,10 @@ vhost_user_if_input (vlib_main_t * vm,
                  if (PREDICT_FALSE
                      (vum->cpus[cpu_index].rx_buffers_len == 0))
                    {
+                     /* Cancel speculation */
+                     to_next--;
+                     n_left_to_next++;
+
                      /*
                       * Checking if there are some left buffers.
                       * If not, just rewind the used buffers and stop.