aboutsummaryrefslogtreecommitdiffstats
path: root/src/vcl/vcl_locked.h
diff options
context:
space:
mode:
authorwanghanlin <wanghanlin@corp.netease.com>2020-12-28 16:19:05 +0800
committerFlorin Coras <florin.coras@gmail.com>2021-01-11 19:50:47 +0000
commitdcacdc4fd90d6cc71aaafccbca3ea91c7481ddbd (patch)
tree9b7abc60a57e8d0640027d15e3584fe413c79b79 /src/vcl/vcl_locked.h
parent56177e64b620b93d3d935cd1f1663e2f7f1e5592 (diff)
vcl: fix deadlock in rpc
Worker thread A send rpc to worker thread B with vls_table_lock when worker thread B try to lock vls_table_lock, so unlock it temporarily. Add worker_rpc_lock to synchronize rpc message among workers to prevent waiting for each other deadly. Add timeout for rpc response to prevent hanging when VPP exit/crash. Type: fix Signed-off-by: wanghanlin <wanghanlin@corp.netease.com> Change-Id: I675f1fe76673ede09107f6eeaaa0eda8bbfc6e61
Diffstat (limited to 'src/vcl/vcl_locked.h')
-rw-r--r--src/vcl/vcl_locked.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/vcl/vcl_locked.h b/src/vcl/vcl_locked.h
index 7cfb3bdc522..11b71eee4af 100644
--- a/src/vcl/vcl_locked.h
+++ b/src/vcl/vcl_locked.h
@@ -21,6 +21,7 @@
#include <vcl/vppcom.h>
#define VLS_INVALID_HANDLE ((int)-1)
+#define VLS_WORKER_RPC_TIMEOUT 3 /* timeout to wait rpc response. */
typedef int vls_handle_t;