From 818eb54de01459ed3d823f8a9781bbed0845db82 Mon Sep 17 00:00:00 2001 From: Dave Barach Date: Wed, 2 Aug 2017 13:56:13 -0400 Subject: Improve the svm fifo allocator - Round up requested fifo size to the next power of two - Maintain per-segment power-of-two freelists - Allocate fifos in chunks, to amortize alignment overhead - Detach builtin test client application after each run so we can use different fifo sizes each time - Be more suspicious of session / application indices Useful prep work for dynamically resizing fifos. As far as the svm fifo code is concerned, it's OK to set fifo->nitems anywhere in the interval: [0, 1<<(fifo->freelist_index) + FIFO_SEGMENT_MIN_FIFO_SIZE] It's unlikely that setting nitems below the path MTU will work out very well... Change-Id: Idad73a027dfb7412056cb02988b77e300fa7e8a7 Signed-off-by: Dave Barach --- src/vnet/tcp/builtin_client.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/vnet/tcp/builtin_client.c') diff --git a/src/vnet/tcp/builtin_client.c b/src/vnet/tcp/builtin_client.c index 938e07ba505..5fa5446091c 100644 --- a/src/vnet/tcp/builtin_client.c +++ b/src/vnet/tcp/builtin_client.c @@ -713,6 +713,20 @@ cleanup: pool_free (tm->sessions); + /* Detach the application, so we can use different fifo sizes next time */ + if (tm->test_client_attached) + { + vnet_app_detach_args_t _da, *da = &_da; + int rv; + + da->app_index = tm->app_index; + + rv = vnet_application_detach (da); + if (rv) + vlib_cli_output (vm, "WARNING: app detach failed..."); + tm->test_client_attached = 0; + tm->app_index = ~0; + } return 0; } -- cgit 1.2.3-korg