summaryrefslogtreecommitdiffstats
path: root/src/vcl/vcl_private.c
diff options
context:
space:
mode:
authorhanlin <hanlin_wang@163.com>2020-07-13 11:09:15 +0800
committerFlorin Coras <florin.coras@gmail.com>2020-08-12 01:57:18 +0000
commita3a489691d7f2813702fae2d915120743b860d62 (patch)
tree23a22a25ebe051be37244c45fc3a0732cc296e0d /src/vcl/vcl_private.c
parent40c07ce7a78af69f7354222d4663a65cd5572049 (diff)
vcl: support multi-threads with session migration
Currently, mutlti-threads only support one dispatch thread and multiple worker threads, eventually only dispatch thread is a vcl worker and can interact with epoll. This patch will register all threads as vcl worker, and then each thread can interact with epoll now. Moreover, session migration also supported, such as socket created in thread A and used (bind, connect and etc.) in thread B. Type: feature Signed-off-by: hanlin <hanlin_wang@163.com> Change-Id: Iab0b43a33466968c1423d7d20faf1460c8589d91
Diffstat (limited to 'src/vcl/vcl_private.c')
-rw-r--r--src/vcl/vcl_private.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/vcl/vcl_private.c b/src/vcl/vcl_private.c
index 300b82c4f21..1dadb628fb8 100644
--- a/src/vcl/vcl_private.c
+++ b/src/vcl/vcl_private.c
@@ -217,7 +217,9 @@ vcl_worker_alloc_and_init ()
wrk->mqs_epfd = -1;
if (vcm->cfg.use_mq_eventfd)
{
+ wrk->vcl_needs_real_epoll = 1;
wrk->mqs_epfd = epoll_create (1);
+ wrk->vcl_needs_real_epoll = 0;
if (wrk->mqs_epfd < 0)
{
clib_unix_warning ("epoll_create() returned");