aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-04-09 18:29:14 -0700
committerDamjan Marion <dmarion@me.com>2019-04-18 13:16:18 +0000
commit0a846806742922d98f1aff9cf1370715e57a2ae5 (patch)
tree5214807e20731453254635ed2d9afa9649eb4469 /src/plugins
parent5a8844bdbf4b055812cce2d7755a175b2cc90b75 (diff)
svm: allow indirect fifo data chunks
Fifos can use multiple memory chunks for simple read/write operations. Adding/removing chunks after assignment not yet supported. Change-Id: I2aceab6aea78059d74e0d3a9993c40d5196d077b Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/unittest/session_test.c2
-rw-r--r--src/plugins/unittest/tcp_test.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/unittest/session_test.c b/src/plugins/unittest/session_test.c
index fa6a99ffbf0..542be604e5b 100644
--- a/src/plugins/unittest/session_test.c
+++ b/src/plugins/unittest/session_test.c
@@ -1817,7 +1817,7 @@ session_test_mq (vlib_main_t * vm, unformat_input_t * input)
s.rx_fifo = rx_fifo;
s.tx_fifo = tx_fifo;
s.session_state = SESSION_STATE_READY;
- counter = (u64 *) rx_fifo->data;
+ counter = (u64 *) rx_fifo->head_chunk->data;
start = vlib_time_now (vm);
pid = fork ();
diff --git a/src/plugins/unittest/tcp_test.c b/src/plugins/unittest/tcp_test.c
index c8d9d5fe247..f7bcad3e67e 100644
--- a/src/plugins/unittest/tcp_test.c
+++ b/src/plugins/unittest/tcp_test.c
@@ -740,7 +740,7 @@ fifo_prepare (u32 fifo_size)
f = svm_fifo_create (fifo_size);
/* Paint fifo data vector with -1's */
- clib_memset (f->data, 0xFF, fifo_size);
+ clib_memset (f->head_chunk->data, 0xFF, fifo_size);
return f;
}
@@ -1375,14 +1375,14 @@ tcp_test_fifo4 (vlib_main_t * vm, unformat_input_t * input)
static u32
fifo_pos (svm_fifo_t * f, u32 pos)
{
- return pos % f->nitems;
+ return pos;
}
static int
tcp_test_fifo5 (vlib_main_t * vm, unformat_input_t * input)
{
svm_fifo_t *f;
- u32 fifo_size = 400, j = 0, offset = 200;
+ u32 fifo_size = 401, j = 0, offset = 200;
int i, rv, verbose = 0;
u8 *test_data = 0, *data_buf = 0;
ooo_segment_t *ooo_seg;