diff options
author | Florin Coras <fcoras@cisco.com> | 2017-12-11 04:59:01 -0800 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2017-12-14 00:45:51 +0000 |
commit | ff6e7699a5e9921d73818970ecf3571080922ecc (patch) | |
tree | f22a28b2024833ae0128b7249ff7f9e71ec29bc7 /src/vnet/tcp | |
parent | cf3561bde53173a7be9aa02ed4897c7f2d55bd0a (diff) |
session: cleanup attach flags
Change-Id: I39d21d15677f57e10b69b8842f2cbca277abddf0
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/tcp')
-rw-r--r-- | src/vnet/tcp/builtin_client.c | 14 | ||||
-rw-r--r-- | src/vnet/tcp/builtin_http_server.c | 13 | ||||
-rw-r--r-- | src/vnet/tcp/builtin_proxy.c | 21 | ||||
-rw-r--r-- | src/vnet/tcp/builtin_server.c | 14 |
4 files changed, 36 insertions, 26 deletions
diff --git a/src/vnet/tcp/builtin_client.c b/src/vnet/tcp/builtin_client.c index 2b4f07dc415..b90773b7586 100644 --- a/src/vnet/tcp/builtin_client.c +++ b/src/vnet/tcp/builtin_client.c @@ -429,10 +429,10 @@ static clib_error_t * attach_builtin_test_clients_app (u8 * appns_id, u64 appns_flags, u64 appns_secret) { + u32 segment_name_length, prealloc_fifos, segment_size = 2 << 20; tclient_main_t *tm = &tclient_main; vnet_app_attach_args_t _a, *a = &_a; u8 segment_name[128]; - u32 segment_name_length, prealloc_fifos; u64 options[16]; clib_error_t *error = 0; @@ -448,12 +448,14 @@ attach_builtin_test_clients_app (u8 * appns_id, u64 appns_flags, prealloc_fifos = tm->prealloc_fifos ? tm->expected_connections : 1; - options[SESSION_OPTIONS_ACCEPT_COOKIE] = 0x12345678; - options[SESSION_OPTIONS_SEGMENT_SIZE] = (2ULL << 32); - options[SESSION_OPTIONS_RX_FIFO_SIZE] = tm->fifo_size; - options[SESSION_OPTIONS_TX_FIFO_SIZE] = tm->fifo_size; + if (tm->private_segment_size) + segment_size = tm->private_segment_size; + + options[APP_OPTIONS_ACCEPT_COOKIE] = 0x12345678; + options[APP_OPTIONS_SEGMENT_SIZE] = segment_size; + options[APP_OPTIONS_RX_FIFO_SIZE] = tm->fifo_size; + options[APP_OPTIONS_TX_FIFO_SIZE] = tm->fifo_size; options[APP_OPTIONS_PRIVATE_SEGMENT_COUNT] = tm->private_segment_count; - options[APP_OPTIONS_PRIVATE_SEGMENT_SIZE] = tm->private_segment_size; options[APP_OPTIONS_PREALLOC_FIFO_PAIRS] = prealloc_fifos; options[APP_OPTIONS_FLAGS] = APP_OPTIONS_FLAGS_IS_BUILTIN; diff --git a/src/vnet/tcp/builtin_http_server.c b/src/vnet/tcp/builtin_http_server.c index 6d58aab6f38..6e1cd8e770e 100644 --- a/src/vnet/tcp/builtin_http_server.c +++ b/src/vnet/tcp/builtin_http_server.c @@ -511,23 +511,26 @@ server_attach () { http_server_main_t *hsm = &http_server_main; u8 segment_name[128]; - u64 options[SESSION_OPTIONS_N_OPTIONS]; + u64 options[APP_OPTIONS_N_OPTIONS]; vnet_app_attach_args_t _a, *a = &_a; + u32 segment_size = 128 << 20; memset (a, 0, sizeof (*a)); memset (options, 0, sizeof (options)); + if (hsm->private_segment_size) + segment_size = hsm->private_segment_size; + a->api_client_index = hsm->my_client_index; a->session_cb_vft = &builtin_session_cb_vft; a->options = options; - a->options[SESSION_OPTIONS_SEGMENT_SIZE] = 128 << 20; - a->options[SESSION_OPTIONS_RX_FIFO_SIZE] = + a->options[APP_OPTIONS_SEGMENT_SIZE] = segment_size; + a->options[APP_OPTIONS_RX_FIFO_SIZE] = hsm->fifo_size ? hsm->fifo_size : 8 << 10; - a->options[SESSION_OPTIONS_TX_FIFO_SIZE] = + a->options[APP_OPTIONS_TX_FIFO_SIZE] = hsm->fifo_size ? hsm->fifo_size : 32 << 10; a->options[APP_OPTIONS_FLAGS] = APP_OPTIONS_FLAGS_IS_BUILTIN; a->options[APP_OPTIONS_PREALLOC_FIFO_PAIRS] = hsm->prealloc_fifos; - a->options[APP_OPTIONS_PRIVATE_SEGMENT_SIZE] = hsm->private_segment_size; a->segment_name = segment_name; a->segment_name_length = ARRAY_LEN (segment_name); diff --git a/src/vnet/tcp/builtin_proxy.c b/src/vnet/tcp/builtin_proxy.c index 779e9b689e0..7f70df39069 100644 --- a/src/vnet/tcp/builtin_proxy.c +++ b/src/vnet/tcp/builtin_proxy.c @@ -383,20 +383,22 @@ server_attach () { builtin_proxy_main_t *bpm = &builtin_proxy_main; u8 segment_name[128]; - u64 options[SESSION_OPTIONS_N_OPTIONS]; + u64 options[APP_OPTIONS_N_OPTIONS]; vnet_app_attach_args_t _a, *a = &_a; + u32 segment_size = 512 << 20; memset (a, 0, sizeof (*a)); memset (options, 0, sizeof (options)); + if (bpm->private_segment_size) + segment_size = bpm->private_segment_size; a->api_client_index = bpm->server_client_index; a->session_cb_vft = &builtin_session_cb_vft; a->options = options; - a->options[SESSION_OPTIONS_SEGMENT_SIZE] = 512 << 20; - a->options[SESSION_OPTIONS_RX_FIFO_SIZE] = bpm->fifo_size; - a->options[SESSION_OPTIONS_TX_FIFO_SIZE] = bpm->fifo_size; + a->options[APP_OPTIONS_SEGMENT_SIZE] = segment_size; + a->options[APP_OPTIONS_RX_FIFO_SIZE] = bpm->fifo_size; + a->options[APP_OPTIONS_TX_FIFO_SIZE] = bpm->fifo_size; a->options[APP_OPTIONS_PRIVATE_SEGMENT_COUNT] = bpm->private_segment_count; - a->options[APP_OPTIONS_PRIVATE_SEGMENT_SIZE] = bpm->private_segment_size; a->options[APP_OPTIONS_PREALLOC_FIFO_PAIRS] = bpm->prealloc_fifos ? bpm->prealloc_fifos : 1; @@ -434,12 +436,11 @@ active_open_attach (void) a->segment_name_length = segment_name_length; a->session_cb_vft = &builtin_clients; - options[SESSION_OPTIONS_ACCEPT_COOKIE] = 0x12345678; - options[SESSION_OPTIONS_SEGMENT_SIZE] = 512 << 20; - options[SESSION_OPTIONS_RX_FIFO_SIZE] = bpm->fifo_size; - options[SESSION_OPTIONS_TX_FIFO_SIZE] = bpm->fifo_size; + options[APP_OPTIONS_ACCEPT_COOKIE] = 0x12345678; + options[APP_OPTIONS_SEGMENT_SIZE] = 512 << 20; + options[APP_OPTIONS_RX_FIFO_SIZE] = bpm->fifo_size; + options[APP_OPTIONS_TX_FIFO_SIZE] = bpm->fifo_size; options[APP_OPTIONS_PRIVATE_SEGMENT_COUNT] = bpm->private_segment_count; - options[APP_OPTIONS_PRIVATE_SEGMENT_SIZE] = bpm->private_segment_size; options[APP_OPTIONS_PREALLOC_FIFO_PAIRS] = bpm->prealloc_fifos ? bpm->prealloc_fifos : 1; diff --git a/src/vnet/tcp/builtin_server.c b/src/vnet/tcp/builtin_server.c index b613b3ae5d5..26cbfe77727 100644 --- a/src/vnet/tcp/builtin_server.c +++ b/src/vnet/tcp/builtin_server.c @@ -273,8 +273,9 @@ server_attach (u8 * appns_id, u64 appns_flags, u64 appns_secret) { builtin_server_main_t *bsm = &builtin_server_main; u8 segment_name[128]; - u64 options[SESSION_OPTIONS_N_OPTIONS]; + u64 options[APP_OPTIONS_N_OPTIONS]; vnet_app_attach_args_t _a, *a = &_a; + u32 segment_size = 512 << 20; memset (a, 0, sizeof (*a)); memset (options, 0, sizeof (options)); @@ -285,14 +286,17 @@ server_attach (u8 * appns_id, u64 appns_flags, u64 appns_secret) else builtin_session_cb_vft.builtin_server_rx_callback = builtin_server_rx_callback; + + if (bsm->private_segment_size) + segment_size = bsm->private_segment_size; + a->api_client_index = bsm->my_client_index; a->session_cb_vft = &builtin_session_cb_vft; a->options = options; - a->options[SESSION_OPTIONS_SEGMENT_SIZE] = 512 << 20; - a->options[SESSION_OPTIONS_RX_FIFO_SIZE] = bsm->fifo_size; - a->options[SESSION_OPTIONS_TX_FIFO_SIZE] = bsm->fifo_size; + a->options[APP_OPTIONS_SEGMENT_SIZE] = segment_size; + a->options[APP_OPTIONS_RX_FIFO_SIZE] = bsm->fifo_size; + a->options[APP_OPTIONS_TX_FIFO_SIZE] = bsm->fifo_size; a->options[APP_OPTIONS_PRIVATE_SEGMENT_COUNT] = bsm->private_segment_count; - a->options[APP_OPTIONS_PRIVATE_SEGMENT_SIZE] = bsm->private_segment_size; a->options[APP_OPTIONS_PREALLOC_FIFO_PAIRS] = bsm->prealloc_fifos ? bsm->prealloc_fifos : 1; |