summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/vnet/devices/af_packet/device.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/vnet/devices/af_packet/device.c b/src/vnet/devices/af_packet/device.c
index 2c2489b55ab..0991378f640 100644
--- a/src/vnet/devices/af_packet/device.c
+++ b/src/vnet/devices/af_packet/device.c
@@ -87,6 +87,7 @@ af_packet_interface_tx (vlib_main_t * vm,
vnet_interface_output_runtime_t *rd = (void *) node->runtime_data;
af_packet_if_t *apif =
pool_elt_at_index (apm->interfaces, rd->dev_instance);
+ clib_spinlock_lock_if_init (&apif->lockp);
int block = 0;
u32 block_size = apif->tx_req->tp_block_size;
u32 frame_size = apif->tx_req->tp_frame_size;
@@ -96,8 +97,6 @@ af_packet_interface_tx (vlib_main_t * vm,
struct tpacket2_hdr *tph;
u32 frame_not_ready = 0;
- clib_spinlock_lock_if_init (&apif->lockp);
-
while (n_left > 0)
{
u32 len;