diff options
author | 2021-01-26 13:56:45 +0100 | |
---|---|---|
committer | 2021-02-05 11:54:14 +0000 | |
commit | e345ee5cb94cb28cac4ba62af67c2c540916a429 (patch) | |
tree | f5653c0f78888281710869907b049720853d8ede /src/plugins/nat/nat.h | |
parent | 839dcc0fb7313638d9b8f52a9db81350dddfe461 (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/nat.h')
-rw-r--r-- | src/plugins/nat/nat.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/plugins/nat/nat.h b/src/plugins/nat/nat.h index 86f6342ab09..d7f60dd2145 100644 --- a/src/plugins/nat/nat.h +++ b/src/plugins/nat/nat.h @@ -36,8 +36,8 @@ #include <nat/lib/lib.h> #include <nat/lib/inlines.h> -/* number of worker handoff frame queue elements */ -#define NAT_FQ_NELTS 64 +/* default number of worker handoff frame queue elements */ +#define NAT_FQ_NELTS_DEFAULT 64 /* NAT buffer flags */ #define SNAT_FLAG_HAIRPINNING (1 << 0) @@ -782,6 +782,9 @@ typedef struct snat_main_s /* pat - dynamic mapping enabled or conneciton tracking */ u8 pat; + /* number of worker handoff frame queue elements */ + u32 frame_queue_nelts; + /* nat44 plugin enabled */ u8 enabled; @@ -1299,6 +1302,15 @@ clib_error_t *nat44_api_hookup (vlib_main_t * vm); int snat_set_workers (uword * bitmap); /** + * @brief Set NAT plugin number of frame queue elements + * + * @param frame_queue_nelts number of worker handoff frame queue elements + * + * @return 0 on success, non-zero value otherwise + */ +int snat_set_frame_queue_nelts (u32 frame_queue_nelts); + +/** * @brief Enable/disable NAT44 feature on the interface * * @param sw_if_index software index of the interface |