aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/nat44_cli.c
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2020-10-26 13:42:41 +0000
committerOle Tr�an <otroan@employees.org>2020-11-03 11:46:44 +0000
commitc358d78c4126c3bd660d16583842ac41afc77a3e (patch)
treee5d6e42fa2c3c29acdb3cd733b1082de38fff0a7 /src/plugins/nat/nat44_cli.c
parentaf4a414eb74d1456121023e6b3aa76af6c16f89a (diff)
nat: bihash: fix buckets calc and remove mem param
Calculate bihash buckets as n_elts / 2.5 rounded to closest pow2 per Damjan's recommendation. Remove memory configuration parameters because bihash init ignores them anyway as it resides in main heap now. Type: improvement Change-Id: I189f463f3c4640106cce4f12d3c5a62969276a82 Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'src/plugins/nat/nat44_cli.c')
-rw-r--r--src/plugins/nat/nat44_cli.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/src/plugins/nat/nat44_cli.c b/src/plugins/nat/nat44_cli.c
index 7c616cda801..9db7db6ef22 100644
--- a/src/plugins/nat/nat44_cli.c
+++ b/src/plugins/nat/nat44_cli.c
@@ -79,9 +79,7 @@ nat44_enable_command_fn (vlib_main_t * vm,
else if (unformat (line_input, "inside-vrf %u", &c.inside_vrf));
else if (unformat (line_input, "outside-vrf %u", &c.outside_vrf));
else if (unformat (line_input, "users %u", &c.users));
- else if (unformat (line_input, "user-memory %u", &c.user_memory));
else if (unformat (line_input, "sessions %u", &c.sessions));
- else if (unformat (line_input, "session-memory %u", &c.session_memory));
else if (unformat (line_input, "user-sessions %u", &c.user_sessions));
else
{
@@ -91,11 +89,9 @@ nat44_enable_command_fn (vlib_main_t * vm,
}
}
- if (c.sessions && c.session_memory)
+ if (!c.sessions)
{
- error =
- clib_error_return (0,
- "either number of sessions or size of the memory is required");
+ error = clib_error_return (0, "number of sessions is required");
goto done;
}
@@ -331,13 +327,9 @@ nat44_show_hash_command_fn (vlib_main_t * vm, unformat_input_t * input,
vlib_cli_output (vm, "-------- hash table parameters --------\n");
vlib_cli_output (vm, "translation buckets: %u", sm->translation_buckets);
- vlib_cli_output (vm, "translation memory size: %U",
- format_memory_size, sm->translation_memory_size);
if (!sm->endpoint_dependent)
{
vlib_cli_output (vm, "user buckets: %u", sm->user_buckets);
- vlib_cli_output (vm, "user memory size: %U",
- format_memory_size, sm->user_memory_size);
}
return 0;
}
@@ -1994,17 +1986,13 @@ VLIB_CLI_COMMAND (nat44_debug_fib_registration_command, static) = {
* vpp# nat44 enable sessions <n> out2in-dpo
* To enable nat44 endpoint-dependent, use:
* vpp# nat44 enable sessions <n> endpoint-dependent
- * To overwrite user hash configuration, use:
- * vpp# nat44 enable sessions <n> user-memory <n>
- * To overwrite session hash configuration, use:
- * vpp# nat44 enable session-memory <n>
* To set inside-vrf outside-vrf, use:
* vpp# nat44 enable sessions <n> inside-vrf <id> outside-vrf <id>
* @cliexend
?*/
VLIB_CLI_COMMAND (nat44_enable_command, static) = {
.path = "nat44 enable",
- .short_help = "nat44 enable sessions <max-number> [users <max-number>] [static-mappig-only [connection-tracking]|out2in-dpo|endpoint-dependent] [inside-vrf <vrf-id>] [outside-vrf <vrf-id>] [user-memory <number>] [session-memory <number>] [user-sessions <max-number>]",
+ .short_help = "nat44 enable sessions <max-number> [users <max-number>] [static-mappig-only [connection-tracking]|out2in-dpo|endpoint-dependent] [inside-vrf <vrf-id>] [outside-vrf <vrf-id>] [user-sessions <max-number>]",
.function = nat44_enable_command_fn,
};