summaryrefslogtreecommitdiffstats
path: root/src/vppinfra/pool.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2022-02-25 00:19:26 +0100
committerFlorin Coras <florin.coras@gmail.com>2022-03-14 17:55:19 +0000
commiteb63caea2aacb60e05f956f0720d95267398e3ff (patch)
treea7f96a8d72fdc82e10a743f66ad47ed146623d4d /src/vppinfra/pool.c
parenta9fe20f4b8f7a9bd65cc8ee1b6a0204af7fc3627 (diff)
vppinfra: don't account vec_header_t size twice in the pool header
Type: fix Change-Id: I298d2a5067f7949002e6c010f892553f1eb9f477 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vppinfra/pool.c')
-rw-r--r--src/vppinfra/pool.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/vppinfra/pool.c b/src/vppinfra/pool.c
index c2f587a93f4..25398455402 100644
--- a/src/vppinfra/pool.c
+++ b/src/vppinfra/pool.c
@@ -55,7 +55,8 @@ _pool_init_fixed (void **pool_ptr, u32 elt_size, u32 max_elts)
ASSERT (elt_size);
ASSERT (max_elts);
- vector_size = pool_aligned_header_bytes + (u64) elt_size *max_elts;
+ vector_size =
+ vec_header_bytes (pool_aligned_header_bytes) + (u64) elt_size * max_elts;
free_index_size = vec_header_bytes (0) + sizeof (u32) * max_elts;
/* Round up to a cache line boundary */
@@ -85,7 +86,7 @@ _pool_init_fixed (void **pool_ptr, u32 elt_size, u32 max_elts)
/* First comes the pool header */
fh = (pool_header_t *) mmap_base;
/* Find the user vector pointer */
- v = (u8 *) (mmap_base + pool_aligned_header_bytes);
+ v = (u8 *) (mmap_base + vec_header_bytes (pool_aligned_header_bytes));
/* Finally, the vector header */
vh = _vec_find (v);