aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra/vec.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2022-03-18 15:48:12 +0100
committerFlorin Coras <florin.coras@gmail.com>2022-03-18 22:17:45 +0000
commit3cfd529bd0f7c11ad39ad82a704d95ee5e818013 (patch)
treef79282cb930137872acb54b629f9cae4dee13e97 /src/vppinfra/vec.c
parentf56b007356c145e0ef56e3590a20771a98383748 (diff)
vppinfra: deprecate vec numa macros
More generic vector heap code coming in another patch... Type: refactor Change-Id: I2327128fb3aba9d5d330f46a35afec32e1e3942e Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vppinfra/vec.c')
-rw-r--r--src/vppinfra/vec.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/src/vppinfra/vec.c b/src/vppinfra/vec.c
index ba842e64d25..300ef8520ed 100644
--- a/src/vppinfra/vec.c
+++ b/src/vppinfra/vec.c
@@ -45,28 +45,18 @@
/* Vector resize operator. Called as needed by various macros such as
vec_add1() when we need to allocate memory. */
__clib_export void *
-vec_resize_allocate_memory (void *v,
- word length_increment,
- uword data_bytes,
- uword header_bytes, uword data_align,
- uword numa_id)
+vec_resize_allocate_memory (void *v, word length_increment, uword data_bytes,
+ uword header_bytes, uword data_align)
{
vec_header_t *vh = _vec_find (v);
uword old_alloc_bytes, new_alloc_bytes;
void *old, *new;
- void *oldheap;
header_bytes = vec_header_bytes (header_bytes);
data_align = data_align == 0 ? 1 : data_align;
data_bytes += header_bytes;
- if (PREDICT_FALSE (numa_id != VEC_NUMA_UNSPECIFIED))
- {
- oldheap = clib_mem_get_per_cpu_heap ();
- clib_mem_set_per_cpu_heap (clib_mem_get_per_numa_heap (numa_id));
- }
-
/* alignment must be power of 2 */
ASSERT (count_set_bits (data_align) == 1);
@@ -80,12 +70,9 @@ vec_resize_allocate_memory (void *v,
CLIB_MEM_POISON (new + data_bytes, new_alloc_bytes - data_bytes);
v = new + header_bytes;
_vec_len (v) = length_increment;
- _vec_numa (v) = numa_id;
ASSERT (header_bytes / VEC_HEADER_ROUND <= 255);
_vec_find (v)->hdr_size = header_bytes / VEC_HEADER_ROUND;
_vec_find (v)->log2_align = min_log2 (data_align);
- if (PREDICT_FALSE (numa_id != VEC_NUMA_UNSPECIFIED))
- clib_mem_set_per_cpu_heap (oldheap);
return v;
}
@@ -107,8 +94,6 @@ vec_resize_allocate_memory (void *v,
if (data_bytes <= old_alloc_bytes)
{
CLIB_MEM_UNPOISON (v, data_bytes);
- if (PREDICT_FALSE (numa_id != VEC_NUMA_UNSPECIFIED))
- clib_mem_set_per_cpu_heap (oldheap);
return v;
}
@@ -144,10 +129,6 @@ vec_resize_allocate_memory (void *v,
memset (v + old_alloc_bytes, 0, new_alloc_bytes - old_alloc_bytes);
CLIB_MEM_POISON (new + data_bytes, new_alloc_bytes - data_bytes);
- _vec_numa ((v + header_bytes)) = numa_id;
- if (PREDICT_FALSE (numa_id != VEC_NUMA_UNSPECIFIED))
- clib_mem_set_per_cpu_heap (oldheap);
-
return v + header_bytes;
}