From: hsandid Date: Mon, 10 Jun 2024 14:06:37 +0000 (+0200) Subject: vlib: require main core with 'skip-cores' attribute X-Git-Tag: v25.10-rc0~97 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F99%2F41099%2F4;p=vpp.git vlib: require main core with 'skip-cores' attribute Type: fix Not specifying main core with 'skip-cores' attribute can result in launch issues e.g. if main thread pinned automatically by scheduler to a cpu in 'skip-cores' range. Change-Id: Ie47b3691e25ed4ff5d53887d3e1d5e8cb2be00b9 Signed-off-by: Hadi Rayan Al-Sandid --- diff --git a/src/vlib/threads.c b/src/vlib/threads.c index 0a5779c2d2e..0d1cf502f6e 100644 --- a/src/vlib/threads.c +++ b/src/vlib/threads.c @@ -1164,6 +1164,11 @@ cpu_config (vlib_main_t * vm, unformat_input_t * input) if (use_corelist && tm->main_lcore == ~0) return clib_error_return (0, "main-core must be specified when using " "corelist-* or coremask-* attribute"); + + if (tm->skip_cores != 0 && tm->main_lcore == ~0) + return clib_error_return ( + 0, "main-core must be specified when using skip-cores attribute"); + if (tm->sched_priority != ~0) { if (tm->sched_policy == SCHED_FIFO || tm->sched_policy == SCHED_RR)