aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib/main.h
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2020-04-09 17:24:07 -0400
committerFlorin Coras <florin.coras@gmail.com>2020-04-13 15:54:31 +0000
commitc74b43c80789f5e437dfe4cc491157b45a7f222e (patch)
tree0d149b8147d8225b5a872e709c6845476575fd1f /src/vlib/main.h
parentc54162981cdd41d65ed283df36955007552ddffe (diff)
buffers: configurable buffer fault injector
When configured at compile time via the cmake VPP_BUFFER_FAULT_INJECTOR option, the buffer allocator will appear to fail a certain fraction of the time. By default, the allocator succeeds 80% of the time. Detailed command line configuration options are available, but only when the image has been compiled with cmake option described above: vlib { buffer-alloc-success-rate [0.0 ... 1.0] buffer-alloc-success-seed <nnnn> } Modify vlib_buffer_pool_create(...) so 0 is always an invalid buffer index. Debug images: add checks for bad buffer index enqueues, and also verify that f->n_vectors doesn't accidentally map one or more instances of the frame poison pattern 0xfefefefe. Type: improvement Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: Iab939858014463d1e664682805013d334d6fcbe5
Diffstat (limited to 'src/vlib/main.h')
-rw-r--r--src/vlib/main.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/vlib/main.h b/src/vlib/main.h
index 0e65c817ae1..598c3ba836f 100644
--- a/src/vlib/main.h
+++ b/src/vlib/main.h
@@ -276,6 +276,10 @@ typedef struct vlib_main_t
uword *processing_rpc_requests;
clib_spinlock_t pending_rpc_lock;
+ /* buffer fault injector */
+ u32 buffer_alloc_success_seed;
+ f64 buffer_alloc_success_rate;
+
} vlib_main_t;
/* Global main structure. */