summaryrefslogtreecommitdiffstats
path: root/src/vlib/threads_cli.c
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2021-12-09 18:24:21 +0100
committerDamjan Marion <dmarion@me.com>2022-04-14 19:20:43 +0000
commit8b153de6cdd8d87ae38447487565b346e735dc86 (patch)
tree1d1a77b6e3949815abee01668cba360372293078 /src/vlib/threads_cli.c
parentaad4298df0d31abe15ac40d0560b0bf196d6c1b5 (diff)
vlib: disable cpu pinning if not configured
In some environment like when running a lot of functional tests, it can be useful to run more VPP instances than CPU and let the Linux scheduler decide what to do. This change disable cpu pinning altogether in the single-threaded case, provided that no main-core is explicitely specified in the config Type: improvement Change-Id: I8c2f36fdd49c00f9adaaeb4c81aefb27c3420a9b Signed-off-by: Benoît Ganne <bganne@cisco.com> Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
Diffstat (limited to 'src/vlib/threads_cli.c')
-rw-r--r--src/vlib/threads_cli.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/vlib/threads_cli.c b/src/vlib/threads_cli.c
index d14e9c50e27..9b304664283 100644
--- a/src/vlib/threads_cli.c
+++ b/src/vlib/threads_cli.c
@@ -43,6 +43,7 @@ static clib_error_t *
show_threads_fn (vlib_main_t * vm,
unformat_input_t * input, vlib_cli_command_t * cmd)
{
+ const vlib_thread_main_t *tm = vlib_get_thread_main ();
vlib_worker_thread_t *w;
int i;
@@ -64,7 +65,7 @@ show_threads_fn (vlib_main_t * vm,
line = format (line, "%-25U", format_sched_policy_and_priority, w->lwp);
int cpu_id = w->cpu_id;
- if (cpu_id > -1)
+ if (cpu_id > -1 && tm->main_lcore != ~0)
{
int core_id = w->core_id;
int numa_id = w->numa_id;