summaryrefslogtreecommitdiffstats
path: root/src/plugins/vmxnet3/output.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/vmxnet3/output.c')
-rw-r--r--src/plugins/vmxnet3/output.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/plugins/vmxnet3/output.c b/src/plugins/vmxnet3/output.c
index 2ca1cc9f107..32b77dec259 100644
--- a/src/plugins/vmxnet3/output.c
+++ b/src/plugins/vmxnet3/output.c
@@ -115,8 +115,15 @@ VNET_DEVICE_CLASS_TX_FN (vmxnet3_device_class) (vlib_main_t * vm,
u16 qid = thread_index;
u16 n_retry = 5;
- txq = vec_elt_at_index (vd->txqs, qid % vd->num_tx_queues);
+ if (PREDICT_FALSE (!(vd->flags & VMXNET3_DEVICE_F_LINK_UP)))
+ {
+ vlib_buffer_free (vm, buffers, n_left);
+ vlib_error_count (vm, node->node_index, VMXNET3_TX_ERROR_LINK_DOWN,
+ n_left);
+ return (0);
+ }
+ txq = vec_elt_at_index (vd->txqs, qid % vd->num_tx_queues);
clib_spinlock_lock_if_init (&txq->lock);
retry: