vlib: queue_hi_thresh fix to avoid deadlock 44/26544/2
authorElias Rudberg <elias.rudberg@bahnhof.net>
Thu, 16 Apr 2020 14:01:52 +0000 (16:01 +0200)
committerOle Trøan <otroan@employees.org>
Tue, 21 Apr 2020 16:53:38 +0000 (16:53 +0000)
commit368104d06ad6d667a8cce152426916fc654b6627
tree956be4c162a7d1f52e3b9fe64d4e42cfbe473b0b
parent958919f3633f4b900d9ecabc7fc75e02014e5626
vlib: queue_hi_thresh fix to avoid deadlock

Adapt queue_hi_thresh value using num_threads to avoid risk of deadlock
between threads which could happen for example when different NAT
threads try to handoff work to each other at the same time when their
frame queues are congested. This change ensures that each thread can
reserve a queue entry without causing problems even in the most extreme
case when all threads attempt to add to the same queue simultaneously
when the queue is nearly full.

Type: fix

Signed-off-by: Elias Rudberg <elias.rudberg@bahnhof.net>
Change-Id: I9e02f753bd00833d8dd500d181b0d4f9a454d703
src/vlib/threads.c