aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib/threads.c
diff options
context:
space:
mode:
authorYi He <yi.he@arm.com>2018-07-17 14:18:41 +0800
committerDamjan Marion <dmarion@me.com>2018-08-01 20:41:04 +0000
commite4a9eb7873f140f88be7fffb83e1215fbf181116 (patch)
treec2fdc9a699a06d1aa085ee767044fd1352ea9469 /src/vlib/threads.c
parentcc4a5e8089967f0c266e9c5ed319c38c111004cd (diff)
Improve cpu { coremask-% } configure option
Accept any sized hexadecimal bitmask specification to support platforms with hundreds of cores. Change-Id: Ib881db0cf60f78bdeffa13acfc2fc7fe7e128cc4 Signed-off-by: Yi He <yi.he@arm.com>
Diffstat (limited to 'src/vlib/threads.c')
-rw-r--r--src/vlib/threads.c24
1 files changed, 4 insertions, 20 deletions
diff --git a/src/vlib/threads.c b/src/vlib/threads.c
index 70f22b10fa1..8e75592c0e2 100644
--- a/src/vlib/threads.c
+++ b/src/vlib/threads.c
@@ -1267,7 +1267,6 @@ cpu_config (vlib_main_t * vm, unformat_input_t * input)
uword *p;
vlib_thread_main_t *tm = &vlib_thread_main;
u8 *name;
- u64 coremask;
uword *bitmap;
u32 count;
@@ -1296,25 +1295,10 @@ cpu_config (vlib_main_t * vm, unformat_input_t * input)
;
else if (unformat (input, "skip-cores %u", &tm->skip_cores))
;
- else if (unformat (input, "coremask-%s %llx", &name, &coremask))
- {
- p = hash_get_mem (tm->thread_registrations_by_name, name);
- if (p == 0)
- return clib_error_return (0, "no such thread type '%s'", name);
-
- tr = (vlib_thread_registration_t *) p[0];
-
- if (tr->use_pthreads)
- return clib_error_return (0,
- "coremask cannot be set for '%s' threads",
- name);
-
- tr->coremask = clib_bitmap_set_multiple
- (tr->coremask, 0, coremask, BITS (coremask));
- tr->count = clib_bitmap_count_set_bits (tr->coremask);
- }
- else if (unformat (input, "corelist-%s %U", &name, unformat_bitmap_list,
- &bitmap))
+ else if (unformat (input, "coremask-%s %U", &name,
+ unformat_bitmap_mask, &bitmap) ||
+ unformat (input, "corelist-%s %U", &name,
+ unformat_bitmap_list, &bitmap))
{
p = hash_get_mem (tm->thread_registrations_by_name, name);
if (p == 0)