summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/ip4_forward.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2017-11-29 05:20:37 -0800
committerDave Barach <openvpp@barachs.net>2017-12-13 16:07:34 +0000
commit1ec3652c25c593a7dcaae293b2f7dbed6eb15963 (patch)
tree73df6da6b53fa963cf6915e9c7d7c453d8bedfe7 /src/vnet/ip/ip4_forward.c
parent8716e6bf43b7043790980c6ef0bd21d42b34a2a1 (diff)
Separate heap for IPv4 mtries
Change-Id: I497e9f6489dd35219bcf2b51ac992467aac4c8eb Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/ip/ip4_forward.c')
-rwxr-xr-xsrc/vnet/ip/ip4_forward.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/vnet/ip/ip4_forward.c b/src/vnet/ip/ip4_forward.c
index d7afc84ea05..c7cf362a3c0 100755
--- a/src/vnet/ip/ip4_forward.c
+++ b/src/vnet/ip/ip4_forward.c
@@ -1189,6 +1189,12 @@ ip4_lookup_init (vlib_main_t * vm)
if ((error = vlib_call_init_function (vm, vnet_feature_init)))
return error;
+ if ((error = vlib_call_init_function (vm, ip4_mtrie_module_init)))
+ return (error);
+ if ((error = vlib_call_init_function (vm, fib_module_init)))
+ return error;
+ if ((error = vlib_call_init_function (vm, mfib_module_init)))
+ return error;
for (i = 0; i < ARRAY_LEN (im->fib_masks); i++)
{
@@ -3166,6 +3172,29 @@ VLIB_CLI_COMMAND (set_ip_classify_command, static) =
};
/* *INDENT-ON* */
+static clib_error_t *
+ip4_config (vlib_main_t * vm, unformat_input_t * input)
+{
+ ip4_main_t *im = &ip4_main;
+ uword heapsize = 0;
+
+ while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
+ {
+ if (unformat (input, "heap-size %U", unformat_memory_size, &heapsize))
+ ;
+ else
+ return clib_error_return (0,
+ "invalid heap-size parameter `%U'",
+ format_unformat_error, input);
+ }
+
+ im->mtrie_heap_size = heapsize;
+
+ return 0;
+}
+
+VLIB_EARLY_CONFIG_FUNCTION (ip4_config, "ip");
+
/*
* fd.io coding-style-patch-verification: ON
*