diff options
author | Mohamed Feroz <mabdulmajeet@marvell.com> | 2024-08-29 08:04:02 +0000 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2024-09-04 17:57:34 +0000 |
commit | 88c836c26719406484c95636e5a7933a29164cd7 (patch) | |
tree | 4697ed30a9e1c07b90a7371448d6c407f11f2ba6 /src/vcl | |
parent | 2f76b57280e76220ed7cad244059aa4f624371f4 (diff) |
vcl: fix vcl issue in multi-thread-workers mode
In some multi-process/thread applications, a connection FD
is created on main process and actual data processing is done
in worker process. The main process does nothing. For such
applications, when multi-thread-workers is enabled, in current
VLS code, the session events are still enqueued to the VCL
worker corresponding to Main process. As the main process is
not dequeuing any event, application doesn't move forward.
This patch fixes this issue by enabling VCL worker
corresponding to the Worker process as listener of the session.
Type: improvement
Signed-off-by: Mohamed Feroz <mabdulmajeet@marvell.com>
Change-Id: Ia7e6270c1acbce7feeafbf281c661285d63c3b22
Diffstat (limited to 'src/vcl')
-rw-r--r-- | src/vcl/vcl_locked.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/vcl/vcl_locked.c b/src/vcl/vcl_locked.c index 69dd15b0ef4..93ece0027ff 100644 --- a/src/vcl/vcl_locked.c +++ b/src/vcl/vcl_locked.c @@ -374,6 +374,12 @@ vls_worker_get_current (void) return pool_elt_at_index (vlsm->workers, vls_get_worker_index ()); } +static inline u8 +vls_n_workers (void) +{ + return pool_elts (vlsm->workers); +} + static void vls_worker_alloc (void) { @@ -1298,7 +1304,7 @@ vls_mp_checks (vcl_locked_session_t * vls, int is_add) vcl_session_t *s; u32 owner_wrk; - if (vls_mt_wrk_supported ()) + if (vls_mt_wrk_supported () && vls_n_workers () <= 1) return; ASSERT (wrk->wrk_index == vls->vcl_wrk_index); |