summaryrefslogtreecommitdiffstats
path: root/src/vlib/buffer.h
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2017-10-12 13:09:26 +0200
committerDave Barach <openvpp@barachs.net>2017-10-25 19:04:06 +0000
commit149ba779cff4ffc48d87ca67a2a8d4afd49b05f5 (patch)
treebc0467669b33b745fe4f44d4d0c787cf53900536 /src/vlib/buffer.h
parenta19d7b822ae9584cde522aefba36915e2af58846 (diff)
vlib: add support for multiple buffer pools
Change-Id: Icaf7d7ad47284aea7a56e8006b69f45874d64202 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vlib/buffer.h')
-rw-r--r--src/vlib/buffer.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/vlib/buffer.h b/src/vlib/buffer.h
index e5c1d21397b..6170323c815 100644
--- a/src/vlib/buffer.h
+++ b/src/vlib/buffer.h
@@ -123,7 +123,8 @@ typedef struct
u8 n_add_refs; /**< Number of additional references to this buffer. */
- u8 dont_waste_me[2]; /**< Available space in the (precious)
+ u8 buffer_pool_index; /**< index of buffer pool this buffer belongs. */
+ u8 dont_waste_me[1]; /**< Available space in the (precious)
first 32 octets of buffer metadata
Before allocating any of it, discussion required!
*/
@@ -405,11 +406,19 @@ extern vlib_buffer_callbacks_t *vlib_buffer_callbacks;
typedef struct
{
CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
+ uword start;
+ uword size;
+ vlib_physmem_region_index_t physmem_region;
+} vlib_buffer_pool_t;
+
+typedef struct
+{
+ CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
/* Virtual memory address and size of buffer memory, used for calculating
buffer index */
uword buffer_mem_start;
uword buffer_mem_size;
- vlib_physmem_region_index_t physmem_region;
+ vlib_buffer_pool_t *buffer_pools;
/* Buffer free callback, for subversive activities */
u32 (*buffer_free_callback) (struct vlib_main_t * vm,
@@ -442,8 +451,9 @@ typedef struct
int callbacks_registered;
} vlib_buffer_main_t;
-void vlib_buffer_add_mem_range (struct vlib_main_t *vm, uword start,
- uword size);
+u8 vlib_buffer_add_physmem_region (struct vlib_main_t *vm,
+ vlib_physmem_region_index_t region);
+
clib_error_t *vlib_buffer_main_init (struct vlib_main_t *vm);
typedef struct