aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib/buffer.h
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2018-10-31 10:59:02 +0100
committerMarco Varlese <marco.varlese@suse.de>2018-11-02 14:01:00 +0000
commitd23f37eeafafe4db0e70de8c898dc8f51bc4482c (patch)
tree5719e74d0a8b40d3b9daf57c5cf9d110adf18327 /src/vlib/buffer.h
parentc92341d5c6ab052d458471e26d6c27f9e303fe31 (diff)
vlib: define minimum chained buffer segment size
Change-Id: I9b5f7b264f9978e3dd97b2d1eb103b7d10ac3170 Signed-off-by: Damjan Marion <damarion@cisco.com> (cherry picked from commit bd0da97e5ac0f84e1ea8e6e7f9549dd4e1a6a4ab)
Diffstat (limited to 'src/vlib/buffer.h')
-rw-r--r--src/vlib/buffer.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/vlib/buffer.h b/src/vlib/buffer.h
index 651e7f0dc8f..9254cfb804f 100644
--- a/src/vlib/buffer.h
+++ b/src/vlib/buffer.h
@@ -51,6 +51,14 @@
#define VLIB_BUFFER_DATA_SIZE (2048)
#define VLIB_BUFFER_PRE_DATA_SIZE __PRE_DATA_SIZE
+/* Minimum buffer chain segment size. Does not apply to last buffer in chain.
+ Dataplane code can safely asume that specified amount of data is not split
+ into 2 chained buffers */
+#define VLIB_BUFFER_MIN_CHAIN_SEG_SIZE (128)
+
+/* Amount of head buffer data copied to each replica head buffer */
+#define VLIB_BUFFER_CLONE_HEAD_SIZE (256)
+
typedef u8 vlib_buffer_free_list_index_t;
/** \file
@@ -212,6 +220,9 @@ vlib_buffer_advance (vlib_buffer_t * b, word l)
ASSERT (b->current_length >= l);
b->current_data += l;
b->current_length -= l;
+
+ ASSERT ((b->flags & VLIB_BUFFER_NEXT_PRESENT) == 0 ||
+ b->current_length >= VLIB_BUFFER_MIN_CHAIN_SEG_SIZE);
}
/** \brief Check if there is enough space in buffer to advance