summaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/builtin_proxy.c
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2017-09-01 19:12:11 -0400
committerFlorin Coras <florin.coras@gmail.com>2017-09-06 18:30:55 +0000
commit91f3e744a37b9f6f3c87ac45e54142f16fd2d3d5 (patch)
treecbb3e1c008206a3209538dc41f8901bb10b7ca9c /src/vnet/tcp/builtin_proxy.c
parent2951d901a5b6ac48b0203b2da9e35ea419b9b4d6 (diff)
Improve "show segment-manager segments"
Clean up private-segment fifo preallocation Change-Id: I53c630ed81d48f2832a204992d73635536926983 Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vnet/tcp/builtin_proxy.c')
-rw-r--r--src/vnet/tcp/builtin_proxy.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/vnet/tcp/builtin_proxy.c b/src/vnet/tcp/builtin_proxy.c
index d8cfb11d315..91377e76726 100644
--- a/src/vnet/tcp/builtin_proxy.c
+++ b/src/vnet/tcp/builtin_proxy.c
@@ -523,7 +523,7 @@ proxy_server_create_command_fn (vlib_main_t * vm, unformat_input_t * input,
{
builtin_proxy_main_t *bpm = &builtin_proxy_main;
int rv;
- u32 tmp;
+ u64 tmp;
bpm->fifo_size = 64 << 10;
bpm->rcv_buffer_size = 1024;
@@ -542,12 +542,14 @@ proxy_server_create_command_fn (vlib_main_t * vm, unformat_input_t * input,
else if (unformat (input, "private-segment-count %d",
&bpm->private_segment_count))
;
- else if (unformat (input, "private-segment-size %dm", &tmp))
- bpm->private_segment_size = tmp << 20;
- else if (unformat (input, "private-segment-size %dg", &tmp))
- bpm->private_segment_size = tmp << 30;
- else if (unformat (input, "private-segment-size %d", &tmp))
- bpm->private_segment_size = tmp;
+ else if (unformat (input, "private-segment-size %U",
+ unformat_memory_size, &tmp))
+ {
+ if (tmp >= 0x100000000ULL)
+ return clib_error_return
+ (0, "private segment size %lld (%llu) too large", tmp, tmp);
+ bpm->private_segment_size = tmp;
+ }
else
return clib_error_return (0, "unknown input `%U'",
format_unformat_error, input);