summaryrefslogtreecommitdiffstats
path: root/vnet/vnet/pg/output.c
diff options
context:
space:
mode:
Diffstat (limited to 'vnet/vnet/pg/output.c')
-rw-r--r--vnet/vnet/pg/output.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/vnet/vnet/pg/output.c b/vnet/vnet/pg/output.c
index 2de06acaea5..64a0b7b9d92 100644
--- a/vnet/vnet/pg/output.c
+++ b/vnet/vnet/pg/output.c
@@ -52,6 +52,10 @@ pg_output (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame)
vnet_interface_output_runtime_t *rd = (void *) node->runtime_data;
pg_interface_t *pif = pool_elt_at_index (pg->interfaces, rd->dev_instance);
+ if (PREDICT_FALSE (pif->lockp != 0))
+ while (__sync_lock_test_and_set (pif->lockp, 1))
+ ;
+
if (pif->pcap_file_name != 0)
{
while (n_left > 0)
@@ -67,6 +71,8 @@ pg_output (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame)
}
vlib_buffer_free_no_next (vm, vlib_frame_args (frame), n_buffers);
+ if (PREDICT_FALSE (pif->lockp != 0))
+ *pif->lockp = 0;
return n_buffers;
}