completelly deprecate os_get_cpu_number, replace new occurences
Change-Id: I82c663bc0866c6c68ba354104b0bb059387f4b9d
Signed-off-by: Damjan Marion <damarion@cisco.com>
diff --git a/src/vppinfra/bihash_template.c b/src/vppinfra/bihash_template.c
index d8b97b5..51fadeb 100644
--- a/src/vppinfra/bihash_template.c
+++ b/src/vppinfra/bihash_template.c
@@ -96,12 +96,12 @@
clib_bihash_bucket_t working_bucket __attribute__ ((aligned (8)));
void *oldheap;
BVT (clib_bihash_value) * working_copy;
- u32 cpu_number = os_get_cpu_number ();
+ u32 thread_index = os_get_thread_index ();
- if (cpu_number >= vec_len (h->working_copies))
+ if (thread_index >= vec_len (h->working_copies))
{
oldheap = clib_mem_set_heap (h->mheap);
- vec_validate (h->working_copies, cpu_number);
+ vec_validate (h->working_copies, thread_index);
clib_mem_set_heap (oldheap);
}
@@ -110,7 +110,7 @@
* updates from multiple threads will not result in sporadic, spurious
* lookup failures.
*/
- working_copy = h->working_copies[cpu_number];
+ working_copy = h->working_copies[thread_index];
h->saved_bucket.as_u64 = b->as_u64;
oldheap = clib_mem_set_heap (h->mheap);
@@ -119,7 +119,7 @@
{
vec_validate_aligned (working_copy, (1 << b->log2_pages) - 1,
sizeof (u64));
- h->working_copies[cpu_number] = working_copy;
+ h->working_copies[thread_index] = working_copy;
}
_vec_len (working_copy) = 1 << b->log2_pages;
@@ -132,7 +132,7 @@
working_bucket.offset = BV (clib_bihash_get_offset) (h, working_copy);
CLIB_MEMORY_BARRIER ();
b->as_u64 = working_bucket.as_u64;
- h->working_copies[cpu_number] = working_copy;
+ h->working_copies[thread_index] = working_copy;
}
static
@@ -233,7 +233,7 @@
int i, limit;
u64 hash, new_hash;
u32 new_log2_pages;
- u32 cpu_number = os_get_cpu_number ();
+ u32 thread_index = os_get_thread_index ();
int mark_bucket_linear;
int resplit_once;
@@ -323,7 +323,7 @@
new_log2_pages = h->saved_bucket.log2_pages + 1;
mark_bucket_linear = 0;
- working_copy = h->working_copies[cpu_number];
+ working_copy = h->working_copies[thread_index];
resplit_once = 0;
new_v = BV (split_and_rehash) (h, working_copy, new_log2_pages);