X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fdevices%2Fvirtio%2Fdevice.c;h=c7efe6519cd260bd73ef23381607522fc4344eaf;hb=829ee5399504478901be245914333fdf704131c2;hp=ae8a116efee68ab8a4c604631f0c2cd73309a452;hpb=b5a86eed8bd889f5c8986e5fa569a50b997ccd77;p=vpp.git diff --git a/src/vnet/devices/virtio/device.c b/src/vnet/devices/virtio/device.c index ae8a116efee..c7efe6519cd 100644 --- a/src/vnet/devices/virtio/device.c +++ b/src/vnet/devices/virtio/device.c @@ -182,6 +182,8 @@ virtio_interface_tx_inline (vlib_main_t * vm, vlib_node_runtime_t * node, u16 mask = sz - 1; u32 *buffers = vlib_frame_args (frame); + clib_spinlock_lock_if_init (&vif->lockp); + /* free consumed buffers */ virtio_free_used_desc (vm, vring); @@ -221,6 +223,8 @@ virtio_interface_tx_inline (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_buffer_free (vm, buffers, n_left); } + clib_spinlock_unlock_if_init (&vif->lockp); + return frame->n_vectors - n_left; }