summaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/virtio/virtio.h
diff options
context:
space:
mode:
authorSteven Luong <sluong@cisco.com>2019-05-22 17:57:25 -0700
committerSteven Luong <sluong@cisco.com>2019-05-23 09:49:32 -0700
commitc2c89782d34df0dc7197b18b042b4c2464a101ef (patch)
tree9de6febd9ae7f6dbaf66c2998a3ded119c696e31 /src/vnet/devices/virtio/virtio.h
parent55203e745f5e3f1f6c4dbe99d6eab8dee4d13ea6 (diff)
tap: crash in multi-thread environment
In tap tx routine, virtio_interface_tx_inline, there used to be an interface spinlock to ensure packets are processed in an orderly fashion clib_spinlock_lock_if_init (&vif->lockp); When virtio code was introduced in 19.04, that line is changed to clib_spinlock_lock_if_init (&vring->lockp); to accommodate multi-queues. Unfortunately, althrough the spinlock exists in the vring, it was never initialized for tap, only for virtio. As a result, many nasty things can happen when running tap interface in multi-thread environment. Crash is inevitable. The fix is to initialize vring->lockp for tap and remove vif->lockp as it is not used anymore. Change-Id: Ibc8f5c8192af550e3940597c06992dfdaccb4c49 Signed-off-by: Steven Luong <sluong@cisco.com>
Diffstat (limited to 'src/vnet/devices/virtio/virtio.h')
-rw-r--r--src/vnet/devices/virtio/virtio.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/src/vnet/devices/virtio/virtio.h b/src/vnet/devices/virtio/virtio.h
index a02d64db061..fb369cafe0a 100644
--- a/src/vnet/devices/virtio/virtio.h
+++ b/src/vnet/devices/virtio/virtio.h
@@ -135,7 +135,6 @@ typedef struct
{
CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
u32 flags;
- clib_spinlock_t lockp;
u32 dev_instance;
u32 hw_if_index;