From dcacdc4fd90d6cc71aaafccbca3ea91c7481ddbd Mon Sep 17 00:00:00 2001 From: wanghanlin Date: Mon, 28 Dec 2020 16:19:05 +0800 Subject: 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 Change-Id: I675f1fe76673ede09107f6eeaaa0eda8bbfc6e61 --- src/vcl/vcl_locked.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/vcl/vcl_locked.h') 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 #define VLS_INVALID_HANDLE ((int)-1) +#define VLS_WORKER_RPC_TIMEOUT 3 /* timeout to wait rpc response. */ typedef int vls_handle_t; -- cgit 1.2.3-korg