summaryrefslogtreecommitdiffstats
path: root/src/plugins/vmxnet3/output.c
diff options
context:
space:
mode:
authorSteven <sluong@cisco.com>2018-10-09 21:12:25 -0700
committerDamjan Marion <dmarion@me.com>2018-10-10 16:06:05 +0000
commit8b0995366110ff8c97d1d10aaa8291ad465b0b2f (patch)
tree5969bbb290c6cf3441d86dd00dd241086e253fde /src/plugins/vmxnet3/output.c
parent40dd73bcfa7625773e1e0cc049134f9d7107bccc (diff)
vmxnet3: better error handling
try harder on output - if there is no descriptor space available, try to free up some and check again. make sure we free the buffer if error is encoutered on input. Change-Id: I41a45213e29de71935afe707889e515037cd081f Signed-off-by: Steven <sluong@cisco.com>
Diffstat (limited to 'src/plugins/vmxnet3/output.c')
-rw-r--r--src/plugins/vmxnet3/output.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/plugins/vmxnet3/output.c b/src/plugins/vmxnet3/output.c
index bcb02949184..2a8494ed447 100644
--- a/src/plugins/vmxnet3/output.c
+++ b/src/plugins/vmxnet3/output.c
@@ -143,15 +143,22 @@ VNET_DEVICE_CLASS_TX_FN (vmxnet3_device_class) (vlib_main_t * vm,
}
if (PREDICT_FALSE (space_left < space_needed))
{
- vlib_buffer_free_one (vm, bi0);
- vlib_error_count (vm, node->node_index,
- VMXNET3_TX_ERROR_NO_FREE_SLOTS, 1);
- buffers++;
- n_left--;
- /*
- * Drop this packet. But we may have enough room for the next packet
- */
- continue;
+ vmxnet3_txq_release (vm, vd, txq);
+ space_left = vmxnet3_tx_ring_space_left (txq);
+
+ if (PREDICT_FALSE (space_left < space_needed))
+ {
+ vlib_buffer_free_one (vm, bi0);
+ vlib_error_count (vm, node->node_index,
+ VMXNET3_TX_ERROR_NO_FREE_SLOTS, 1);
+ buffers++;
+ n_left--;
+ /*
+ * Drop this packet. But we may have enough room for the next
+ * packet
+ */
+ continue;
+ }
}
/*