diff options
Diffstat (limited to 'src/vnet/tls')
-rw-r--r-- | src/vnet/tls/tls.c | 12 | ||||
-rw-r--r-- | src/vnet/tls/tls.h | 1 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/vnet/tls/tls.c b/src/vnet/tls/tls.c index 0787c22f763..3996be1cd2c 100644 --- a/src/vnet/tls/tls.c +++ b/src/vnet/tls/tls.c @@ -1096,7 +1096,6 @@ tls_transport_listener_endpoint_get (u32 ctx_handle, static clib_error_t * tls_enable (vlib_main_t * vm, u8 is_en) { - u32 add_segment_size = 256 << 20, first_seg_size = 32 << 20; vnet_app_detach_args_t _da, *da = &_da; vnet_app_attach_args_t _a, *a = &_a; u64 options[APP_OPTIONS_N_OPTIONS]; @@ -1111,7 +1110,6 @@ tls_enable (vlib_main_t * vm, u8 is_en) return 0; } - first_seg_size = tm->first_seg_size ? tm->first_seg_size : first_seg_size; fifo_size = tm->fifo_size ? tm->fifo_size : fifo_size; clib_memset (a, 0, sizeof (*a)); @@ -1121,8 +1119,8 @@ tls_enable (vlib_main_t * vm, u8 is_en) a->api_client_index = APP_INVALID_INDEX; a->options = options; a->name = format (0, "tls"); - a->options[APP_OPTIONS_SEGMENT_SIZE] = first_seg_size; - a->options[APP_OPTIONS_ADD_SEGMENT_SIZE] = add_segment_size; + a->options[APP_OPTIONS_SEGMENT_SIZE] = tm->first_seg_size; + a->options[APP_OPTIONS_ADD_SEGMENT_SIZE] = tm->add_seg_size; a->options[APP_OPTIONS_RX_FIFO_SIZE] = fifo_size; a->options[APP_OPTIONS_TX_FIFO_SIZE] = fifo_size; a->options[APP_OPTIONS_FLAGS] = APP_OPTIONS_FLAGS_IS_BUILTIN; @@ -1316,6 +1314,9 @@ tls_init (vlib_main_t * vm) vec_validate (tm->rx_bufs, num_threads - 1); vec_validate (tm->tx_bufs, num_threads - 1); + tm->first_seg_size = 32 << 20; + tm->add_seg_size = 256 << 20; + transport_register_protocol (TRANSPORT_PROTO_TLS, &tls_proto, FIB_PROTOCOL_IP4, ~0); transport_register_protocol (TRANSPORT_PROTO_TLS, &tls_proto, @@ -1344,6 +1345,9 @@ tls_config_fn (vlib_main_t * vm, unformat_input_t * input) else if (unformat (input, "first-segment-size %U", unformat_memory_size, &tm->first_seg_size)) ; + else if (unformat (input, "add-segment-size %U", unformat_memory_size, + &tm->add_seg_size)) + ; else if (unformat (input, "fifo-size %U", unformat_memory_size, &tmp)) { if (tmp >= 0x100000000ULL) diff --git a/src/vnet/tls/tls.h b/src/vnet/tls/tls.h index eba70c0a8bb..4e2fabd5669 100644 --- a/src/vnet/tls/tls.h +++ b/src/vnet/tls/tls.h @@ -102,6 +102,7 @@ typedef struct tls_main_ u8 use_test_cert_in_ca; char *ca_cert_path; u64 first_seg_size; + u64 add_seg_size; u32 fifo_size; } tls_main_t; |