diff options
Diffstat (limited to 'helper/test/linux/process.c')
-rw-r--r-- | helper/test/linux/process.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/helper/test/linux/process.c b/helper/test/linux/process.c index e08ef8686..12504d01b 100644 --- a/helper/test/linux/process.c +++ b/helper/test/linux/process.c @@ -4,6 +4,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ +#include "config.h" + #include <odph_debug.h> #include <odp_api.h> #include <odp/helper/linux/pthread.h> @@ -56,9 +58,10 @@ int main(int argc ODPH_UNUSED, char *argv[] ODPH_UNUSED) cpu = odp_cpumask_first(&cpu_mask); printf("the first CPU: %i\n", cpu); - /* reserve cpu 0 for the control plane so remove it from - * the default mask */ - odp_cpumask_clr(&cpu_mask, 0); + /* If possible, remove CPU 0 from the default mask to reserve it for the + * control plane. */ + if (num_workers > 1) + odp_cpumask_clr(&cpu_mask, 0); num_workers = odp_cpumask_count(&cpu_mask); (void)odp_cpumask_to_str(&cpu_mask, cpumaskstr, sizeof(cpumaskstr)); printf("new cpu mask: %s\n", cpumaskstr); |