diff options
author | Florin Coras <fcoras@cisco.com> | 2018-01-31 06:52:17 -0800 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2018-02-05 21:45:28 +0000 |
commit | a332c46a51f9b4e13963340dfee1318e7513c124 (patch) | |
tree | fde1056972c5b164987bd15ce0530a3d48d1bbd7 /src/vnet/session-apps/echo_client.c | |
parent | e71eb5922a293eca36dbd323970741daaca3c5c7 (diff) |
session: segment manager refactor
- use valloc as a 'central' segment baseva manager
- use per segment manager segment pools and use rwlocks to guard them
- add session test that exercises segment creation
- embed segment manager properties into application since they're shared
- fix rw locks
Change-Id: I761164c147275d9e8a926f1eda395e090d231f9a
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session-apps/echo_client.c')
-rw-r--r-- | src/vnet/session-apps/echo_client.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/vnet/session-apps/echo_client.c b/src/vnet/session-apps/echo_client.c index c38b5339453..27e253a9235 100644 --- a/src/vnet/session-apps/echo_client.c +++ b/src/vnet/session-apps/echo_client.c @@ -413,13 +413,21 @@ echo_clients_rx_callback (stream_session_t * s) return 0; } +int +echo_client_add_segment_callback (u32 client_index, const ssvm_private_t * sp) +{ + /* New heaps may be added */ + return 0; +} + /* *INDENT-OFF* */ static session_cb_vft_t echo_clients = { .session_reset_callback = echo_clients_session_reset_callback, .session_connected_callback = echo_clients_session_connected_callback, .session_accept_callback = echo_clients_session_create_callback, .session_disconnect_callback = echo_clients_session_disconnect_callback, - .builtin_server_rx_callback = echo_clients_rx_callback + .builtin_server_rx_callback = echo_clients_rx_callback, + .add_segment_callback = echo_client_add_segment_callback }; /* *INDENT-ON* */ @@ -445,6 +453,7 @@ echo_clients_attach (u8 * appns_id, u64 appns_flags, u64 appns_secret) options[APP_OPTIONS_ACCEPT_COOKIE] = 0x12345678; options[APP_OPTIONS_SEGMENT_SIZE] = segment_size; + options[APP_OPTIONS_ADD_SEGMENT_SIZE] = segment_size; options[APP_OPTIONS_RX_FIFO_SIZE] = ecm->fifo_size; options[APP_OPTIONS_TX_FIFO_SIZE] = ecm->fifo_size; options[APP_OPTIONS_PRIVATE_SEGMENT_COUNT] = ecm->private_segment_count; @@ -625,7 +634,7 @@ echo_clients_command_fn (vlib_main_t * vm, else if (unformat (input, "test-bytes")) ecm->test_bytes = 1; else - return clib_error_return (0, "unknown input `%U'", + return clib_error_return (0, "failed: unknown input `%U'", format_unformat_error, input); } |