aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/virtio/node.c
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2020-09-15 10:58:07 +0200
committerDamjan Marion <dmarion@me.com>2020-09-18 10:40:47 +0000
commitb6b484d01adb8ab2ef5a50d5a3d6f3f097df2e0c (patch)
tree62cf123032c0cfbc02ef31c8e7bea329af77e072 /src/vnet/devices/virtio/node.c
parent1965f750bf5f399a11c75d7ba14a52a504c69227 (diff)
virtio: fix txq locking
Initialize txq lock only if some txq are shared and check if another worker is already operating on the txq before processing gro timeouts in input node. Type: fix Change-Id: I89dab6c0e6eb6a7aa621fa1548b0a2c76e6c7581 Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'src/vnet/devices/virtio/node.c')
-rw-r--r--src/vnet/devices/virtio/node.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/vnet/devices/virtio/node.c b/src/vnet/devices/virtio/node.c
index 7fabe36401c..1c9cfd0cc03 100644
--- a/src/vnet/devices/virtio/node.c
+++ b/src/vnet/devices/virtio/node.c
@@ -279,10 +279,12 @@ virtio_device_input_gso_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
u16 last = vring->last_used_idx;
u16 n_left = vring->used->idx - last;
- if (vif->packet_coalesce)
+ if (vif->packet_coalesce
+ && clib_spinlock_trylock_if_init (&txq_vring->lockp))
{
vnet_gro_flow_table_schedule_node_on_dispatcher (vm,
txq_vring->flow_table);
+ clib_spinlock_unlock_if_init (&txq_vring->lockp);
}
if ((vring->used->flags & VRING_USED_F_NO_NOTIFY) == 0 &&