vcl: mt detection and cleanup

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I521c110fd4d7445bd585c96d4c768f16a0a7d3b8
This commit is contained in:
Florin Coras
2020-08-11 22:05:28 -07:00
parent a3a489691d
commit ff40d8f1b2
4 changed files with 109 additions and 67 deletions

View File

@ -2438,9 +2438,10 @@ ldp_epoll_pwait_eventfd (int epfd, struct epoll_event *events,
return -1;
}
if (vls_mt_wrk_supported ())
if (PREDICT_FALSE (vppcom_worker_index () == ~0))
vls_register_vcl_worker ();
/* Make sure the vcl worker is valid. Could be that epoll fd was created on
* one thread but it is now used on another */
if (PREDICT_FALSE (vppcom_worker_index () == ~0))
vls_register_vcl_worker ();
ldpw = ldp_worker_get_current ();
if (epfd == ldpw->vcl_mq_epfd)

View File

@ -498,10 +498,11 @@ vppcom_cfg_read_file (char *conf_fname)
VCFG_DBG (0, "VCL<%d>: configured tls-engine %u (0x%x)",
getpid (), vcl_cfg->tls_engine, vcl_cfg->tls_engine);
}
else if (unformat (line_input, "multi-thread"))
else if (unformat (line_input, "multi-thread-workers"))
{
vcl_cfg->mt_supported = 1;
VCFG_DBG (0, "VCL<%d>: configured with multithread", getpid ());
vcl_cfg->mt_wrk_supported = 1;
VCFG_DBG (0, "VCL<%d>: configured with multithread workers",
getpid ());
}
else if (unformat (line_input, "}"))
{

File diff suppressed because it is too large Load Diff

View File

@ -218,7 +218,7 @@ typedef struct vppcom_cfg_t_
u8 *vpp_api_socket_name;
u8 *vpp_api_chroot;
u32 tls_engine;
u8 mt_supported;
u8 mt_wrk_supported;
} vppcom_cfg_t;
void vppcom_cfg (vppcom_cfg_t * vcl_cfg);