summaryrefslogtreecommitdiffstats
path: root/src/vnet/session/application.c
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2017-05-30 09:30:07 -0400
committerFlorin Coras <florin.coras@gmail.com>2017-06-01 16:02:55 +0000
commit10d8cc6bf92851fcaec4a6b4c6d3554dc1eb2386 (patch)
treec146b324f974aa13499a1d784a96ef96438c9d15 /src/vnet/session/application.c
parent26261594a0b821770aa0a646cba8399aa6320c2e (diff)
Improve fifo allocator performance
- add option to preallocate fifos in a segment - track active fifos with doubly linked list instead of vector - update udp redirect test code to read fifo pointers from API call instead of digging them up from fifo segment header - input-node based active-open session generator Change-Id: I804b81e99d95f8690d17e12660c6645995e28a9a Signed-off-by: Dave Barach <dave@barachs.net> Signed-off-by: Florin Coras <fcoras@cisco.com> Signed-off-by: Dave Barach <dbarach@cisco.com>
Diffstat (limited to 'src/vnet/session/application.c')
-rw-r--r--src/vnet/session/application.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/vnet/session/application.c b/src/vnet/session/application.c
index ccf9837f4cc..c679b1f53f8 100644
--- a/src/vnet/session/application.c
+++ b/src/vnet/session/application.c
@@ -160,6 +160,7 @@ application_init (application_t * app, u32 api_client_index, u64 * options,
props->rx_fifo_size = options[SESSION_OPTIONS_RX_FIFO_SIZE];
props->tx_fifo_size = options[SESSION_OPTIONS_TX_FIFO_SIZE];
props->add_segment = props->add_segment_size != 0;
+ props->preallocated_fifo_pairs = options[APP_OPTIONS_PREALLOC_FIFO_PAIRS];
props->use_private_segment = options[APP_OPTIONS_FLAGS]
& APP_OPTIONS_FLAGS_BUILTIN_APP;
@@ -395,7 +396,7 @@ application_format_connects (application_t * app, int verbose)
vlib_main_t *vm = vlib_get_main ();
segment_manager_t *sm;
u8 *app_name, *s = 0;
- int i, j;
+ int j;
/* Header */
if (app == 0)
@@ -419,22 +420,16 @@ application_format_connects (application_t * app, int verbose)
for (j = 0; j < vec_len (sm->segment_indices); j++)
{
svm_fifo_segment_private_t *fifo_segment;
- svm_fifo_t **fifos;
+ svm_fifo_t *fifo;
u8 *str;
fifo_segment = svm_fifo_get_segment (sm->segment_indices[j]);
- fifos = svm_fifo_segment_get_fifos (fifo_segment);
- for (i = 0; i < vec_len (fifos); i++)
+ fifo = svm_fifo_segment_get_fifo_list (fifo_segment);
+ while (fifo)
{
- svm_fifo_t *fifo;
u32 session_index, thread_index;
stream_session_t *session;
- /* There are 2 fifos/session. Avoid printing twice. */
- if (i % 2)
- continue;
-
- fifo = fifos[i];
session_index = fifo->master_session_index;
thread_index = fifo->master_thread_index;
@@ -448,9 +443,10 @@ application_format_connects (application_t * app, int verbose)
s = format (s, "%-40s%-20s", str, app_name);
vlib_cli_output (vm, "%v", s);
-
vec_reset_length (s);
vec_free (str);
+
+ fifo = fifo->next;
}
vec_free (s);
}