summaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/nat44_api.c
diff options
context:
space:
mode:
authorElias Rudberg <elias.rudberg@bahnhof.net>2021-01-26 13:56:45 +0100
committerOle Tr�an <otroan@employees.org>2021-02-05 11:54:14 +0000
commite345ee5cb94cb28cac4ba62af67c2c540916a429 (patch)
treef5653c0f78888281710869907b049720853d8ede /src/plugins/nat/nat44_api.c
parent839dcc0fb7313638d9b8f52a9db81350dddfe461 (diff)
nat: configurable handoff frame queue size
Make number of worker handoff frame queue elements configurable as a set nat frame-queue-nelts command. The default value is 64 which is the same value that was previously hard-coded. The idea is that allowing larger values can be useful in some cases, to avoid congestion drops. Also add nat_set_fq_options API support and a corresponding test case. Type: improvement Change-Id: I5c321eb2d7997f76fac2703d9c4a5b2516375db3 Signed-off-by: Elias Rudberg <elias.rudberg@bahnhof.net>
Diffstat (limited to 'src/plugins/nat/nat44_api.c')
-rw-r--r--src/plugins/nat/nat44_api.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/plugins/nat/nat44_api.c b/src/plugins/nat/nat44_api.c
index c025db74f2e..05a79719261 100644
--- a/src/plugins/nat/nat44_api.c
+++ b/src/plugins/nat/nat44_api.c
@@ -334,6 +334,31 @@ vl_api_nat_get_timeouts_t_handler (vl_api_nat_get_timeouts_t * mp)
}
static void
+vl_api_nat_set_fq_options_t_handler (vl_api_nat_set_fq_options_t *mp)
+{
+ snat_main_t *sm = &snat_main;
+ vl_api_nat_set_fq_options_reply_t *rmp;
+ int rv = 0;
+ u32 frame_queue_nelts = ntohl (mp->frame_queue_nelts);
+ rv = snat_set_frame_queue_nelts (frame_queue_nelts);
+ REPLY_MACRO (VL_API_NAT_SET_FQ_OPTIONS_REPLY);
+}
+
+static void
+vl_api_nat_show_fq_options_t_handler (vl_api_nat_show_fq_options_t *mp)
+{
+ vl_api_nat_show_fq_options_reply_t *rmp;
+ snat_main_t *sm = &snat_main;
+ int rv = 0;
+ /* clang-format off */
+ REPLY_MACRO2_ZERO (VL_API_NAT_SHOW_FQ_OPTIONS_REPLY,
+ ({
+ rmp->frame_queue_nelts = htonl (sm->frame_queue_nelts);
+ }));
+ /* clang-format on */
+}
+
+static void
vl_api_nat_set_addr_and_port_alloc_alg_t_handler
(vl_api_nat_set_addr_and_port_alloc_alg_t * mp)
{