aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib/buffer.h
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2017-08-29 00:15:35 +0200
committerDave Barach <openvpp@barachs.net>2017-08-30 16:27:59 +0000
commitb6a8ed7fa0709bbf8e091826803f50e6330689cf (patch)
treec2ef25e9c05c4a2685d3b207b82929c932cfaeff /src/vlib/buffer.h
parent50958959b57c9c2d3fc72ae7588c53d1804aeb86 (diff)
Thread safe internal buffer manager, take two
First attempt to make internal buffer manager thread safe was not succesfull, so trying again. This time with more testing. Change-Id: I01b8385a9c26d233934a3339255ea4bd31c865ac Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vlib/buffer.h')
-rw-r--r--src/vlib/buffer.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/vlib/buffer.h b/src/vlib/buffer.h
index 9047ca9a..5504bf7c 100644
--- a/src/vlib/buffer.h
+++ b/src/vlib/buffer.h
@@ -350,6 +350,12 @@ typedef struct vlib_buffer_free_list_t
/* Vector of free buffers. Each element is a byte offset into I/O heap. */
u32 *buffers;
+ /* global vector of free buffers, used only on main thread.
+ Bufers are returned to global buffers only in case when number of
+ buffers on free buffers list grows about threshold */
+ u32 *global_buffers;
+ clib_spinlock_t global_buffers_lock;
+
/* Memory chunks allocated for this free list
recorded here so they can be freed when free list
is deleted. */