aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSteven <sluong@cisco.com>2017-02-03 09:30:37 -0800
committerDamjan Marion <dmarion.lists@gmail.com>2017-02-03 18:57:50 +0000
commit62411e7d82dc4562003651a53e723ea938be2ebd (patch)
tree915e93bfd0efba5eef3165dea551f4eb52d129a5 /src
parente0cb0ccee10f1ce0e29c94acb3b4861f46c0879d (diff)
vhost-user: fix missing speculative enqueue unwind
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>
Diffstat (limited to 'src')
-rw-r--r--src/vnet/devices/virtio/vhost-user.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/vnet/devices/virtio/vhost-user.c b/src/vnet/devices/virtio/vhost-user.c
index ac14286747a..9b8c18882ca 100644
--- a/src/vnet/devices/virtio/vhost-user.c
+++ b/src/vnet/devices/virtio/vhost-user.c
@@ -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.