diff options
author | Florin Coras <fcoras@cisco.com> | 2020-02-06 16:59:31 +0000 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2020-02-26 00:51:15 +0000 |
commit | 8e755a16a71c55555f12381c8a12e22ae7138536 (patch) | |
tree | adb4105172505435f428ccb8f5ea513e0b2f0402 /src/plugins | |
parent | 9e61d9a1aafbaecbc7b316fd94122b80c3f99905 (diff) |
svm: support multi-chunk fifo chunk alloc
Type: feature
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Id601cd241a2d124d3189057edab4299ffde7ee32
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/unittest/svm_fifo_test.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/unittest/svm_fifo_test.c b/src/plugins/unittest/svm_fifo_test.c index 16fcf8871f5..7221fb8345e 100644 --- a/src/plugins/unittest/svm_fifo_test.c +++ b/src/plugins/unittest/svm_fifo_test.c @@ -2260,10 +2260,11 @@ sfifo_test_fifo_segment_fifo_grow (int verbose) /* * Allocate fifo and try to grow beyond available space */ - f = fifo_segment_alloc_fifo (fs, fifo_size, FIFO_SEGMENT_RX_FIFO); + f = fifo_segment_alloc_fifo (fs, fifo_segment_free_bytes (fs), + FIFO_SEGMENT_RX_FIFO); /* Try to force fifo growth */ - svm_fifo_set_size (f, svm_fifo_size (f) + n_free_chunk_bytes); + svm_fifo_set_size (f, svm_fifo_size (f) + n_free_chunk_bytes + 1); validate_test_and_buf_vecs (&test_data, &data_buf, svm_fifo_size (f)); rv = svm_fifo_enqueue (f, svm_fifo_size (f), test_data); @@ -2570,7 +2571,6 @@ sfifo_test_fifo_segment (vlib_main_t * vm, unformat_input_t * input) { int rv, verbose = 0; - fifo_segment_main_init (&segment_main, HIGH_SEGMENT_BASEVA, 5); while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) { if (unformat (input, "verbose")) @@ -2632,7 +2632,7 @@ svm_fifo_test (vlib_main_t * vm, unformat_input_t * input, int res = 0; char *str; - + fifo_segment_main_init (&segment_main, HIGH_SEGMENT_BASEVA << 3, 5); while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) { if (unformat (input, "fifo1")) |