aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven <sluong@cisco.com>2017-02-03 09:30:37 -0800
committerDamjan Marion <damarion@cisco.com>2017-02-03 20:56:35 +0100
commite23472662cfac98649b3cbc7a2a3b80806ade54f (patch)
tree2bc01abe3da1d47146c8d33deeb9033e966c4f93
parent43c9c959ff42e8357bb6ad62565ce931cfda9f72 (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>
-rw-r--r--vnet/vnet/devices/virtio/vhost-user.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/vnet/vnet/devices/virtio/vhost-user.c b/vnet/vnet/devices/virtio/vhost-user.c
index 88f9ddecdbc..655df145979 100644
--- a/vnet/vnet/devices/virtio/vhost-user.c
+++ b/vnet/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.