diff options
author | Damjan Marion <damarion@cisco.com> | 2019-03-12 18:14:15 +0100 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2019-10-28 14:07:27 +0000 |
commit | b6e8b1a7c8bf9f9fbd05cdc3c90111d9e7a6897b (patch) | |
tree | add9c6ecd3321e299c698f2763b2db70b01b6893 /src/vlib/buffer.h | |
parent | 38f7ccbce0c9f4c4c9fbd37232ac1365b5dc1252 (diff) |
vlib: don't use vector for keeping buffer indices in the pool
Type: refactor
Change-Id: I72221b97d7e0bf5c93e20bbda4473ca67bfcdeb4
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vlib/buffer.h')
-rw-r--r-- | src/vlib/buffer.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/vlib/buffer.h b/src/vlib/buffer.h index c8761af4d20..c2ca8214162 100644 --- a/src/vlib/buffer.h +++ b/src/vlib/buffer.h @@ -411,12 +411,15 @@ vlib_buffer_pull (vlib_buffer_t * b, u8 size) /* Forward declaration. */ struct vlib_main_t; +#define VLIB_BUFFER_POOL_PER_THREAD_CACHE_SZ 512 + typedef struct { CLIB_CACHE_LINE_ALIGN_MARK (cacheline0); - u32 *cached_buffers; - u32 n_alloc; + u32 cached_buffers[VLIB_BUFFER_POOL_PER_THREAD_CACHE_SZ]; + u32 n_cached; } vlib_buffer_pool_thread_t; + typedef struct { CLIB_CACHE_LINE_ALIGN_MARK (cacheline0); @@ -428,6 +431,7 @@ typedef struct u32 physmem_map_index; u32 data_size; u32 n_buffers; + u32 n_avail; u32 *buffers; u8 *name; clib_spinlock_t lock; |