From 5de3fec531691a81b3f77ed965488dc8dbf1e9a1 Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Wed, 6 Feb 2019 14:22:32 +0100 Subject: buffers: make buffer data size configurable from startup config Example: buffers { default data-size 1536 } Change-Id: I5b4436850ca18025c9fdcfc7ed648c2c2732d660 Signed-off-by: Damjan Marion --- src/vnet/ip/ip_frag.c | 3 ++- src/vnet/ip/ping.c | 5 +++-- src/vnet/ip/punt.c | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src/vnet/ip') diff --git a/src/vnet/ip/ip_frag.c b/src/vnet/ip/ip_frag.c index de297767a70..6ecaa3c4dce 100644 --- a/src/vnet/ip/ip_frag.c +++ b/src/vnet/ip/ip_frag.c @@ -106,7 +106,8 @@ ip4_frag_do_fragment (vlib_main_t * vm, u32 from_bi, u32 ** buffer, rem = clib_net_to_host_u16 (ip4->length) - sizeof (ip4_header_t); max = - (clib_min (mtu, VLIB_BUFFER_DATA_SIZE) - sizeof (ip4_header_t)) & ~0x7; + (clib_min (mtu, vlib_bufer_get_default_size (vm)) - + sizeof (ip4_header_t)) & ~0x7; if (rem > (vlib_buffer_length_in_chain (vm, from_b) - sizeof (ip4_header_t))) diff --git a/src/vnet/ip/ping.c b/src/vnet/ip/ping.c index 890285f2606..90314b541c4 100755 --- a/src/vnet/ip/ping.c +++ b/src/vnet/ip/ping.c @@ -388,7 +388,7 @@ init_icmp46_echo_request (vlib_main_t * vm, vlib_buffer_t * b0, int l34_len = l4_header_offset + sizeof (icmp46_header_t) + offsetof (icmp46_echo_request_t, data); - int max_data_len = VLIB_BUFFER_DATA_SIZE - l34_len; + int max_data_len = vlib_bufer_get_default_size (vm) - l34_len; int first_buf_data_len = data_len < max_data_len ? data_len : max_data_len; @@ -403,7 +403,8 @@ init_icmp46_echo_request (vlib_main_t * vm, vlib_buffer_t * b0, { int this_buf_data_len = remaining_data_len < - VLIB_BUFFER_DATA_SIZE ? remaining_data_len : VLIB_BUFFER_DATA_SIZE; + vlib_bufer_get_default_size (vm) ? remaining_data_len : + vlib_bufer_get_default_size (vm); int n_alloc = vlib_buffer_alloc (vm, &b0->next_buffer, 1); if (n_alloc < 1) { diff --git a/src/vnet/ip/punt.c b/src/vnet/ip/punt.c index 65e62c07aba..8331a876dcb 100644 --- a/src/vnet/ip/punt.c +++ b/src/vnet/ip/punt.c @@ -497,7 +497,7 @@ format_punt_trace (u8 * s, va_list * va) static uword punt_socket_rx_fd (vlib_main_t * vm, vlib_node_runtime_t * node, u32 fd) { - const uword buffer_size = VLIB_BUFFER_DATA_SIZE; + const uword buffer_size = vlib_bufer_get_default_size (vm); u32 n_trace = vlib_get_trace_count (vm, node); u32 next = node->cached_next_index; u32 n_left_to_next, next_index; -- cgit 1.2.3-korg