VPP-1102: fix dangling references in RPC handling 58/9858/3
authorDave Barach <dbarach@cisco.com>
Fri, 15 Dec 2017 17:22:57 +0000 (12:22 -0500)
committerJohn Lo <loj@cisco.com>
Fri, 15 Dec 2017 22:32:11 +0000 (22:32 +0000)
commit2877eee189993dbd1b9a5c3d22499930a4768786
tree7c106163b2595a06441c329a2781537929296bc9
parent891f0a1caa795ed7799f0c6faa1cb91b4669d4da
VPP-1102: fix dangling references in RPC handling

Queue RPC calls and send them from the main dispatch loop. As things stood,
if the vpp main input queue filled, worker threads could enter a
barrier-sync spin-wait in the middle of processing a frame. If thread
0 decided to recreate worker thread data structures, the worker thread(s)
could easily crash.

Legislate the problem out of existence by enqueueing RPC messages only
from the main dispatch loop. At that point, doing a barrier-sync wait
is perfectly OK.

Change-Id: I18da3e44bb1f29a63fe5f30cf11de732ecfd5bf7
Signed-off-by: Dave Barach <dave@barachs.net>
src/vlib/main.c
src/vlib/main.h
src/vlib/threads.c
src/vlibmemory/api_common.h
src/vlibmemory/memory_vlib.c