diff options
author | Nathan Skrzypczak <nathan.skrzypczak@gmail.com> | 2020-11-04 11:41:05 +0100 |
---|---|---|
committer | Beno�t Ganne <bganne@cisco.com> | 2023-08-09 08:23:45 +0000 |
commit | 6d733a93b2eb9c16196ee17d5cdc77db21589571 (patch) | |
tree | 7e23016a4ceafedfe85974b58d56a4007780c52b /src/plugins/cnat/cnat_types.c | |
parent | 897844d1e96797f69e3e7e11d237d847fe4e46bf (diff) |
cnat: remove rwlock on ts
Type: improvement
Remove rwlock contention on timestamps. ~10% pps with
10k sessions. Use fixed-size-pools of increasing sizes
starting with 4K, and with a x2 step each time.
We don't free/shrink allocated pools.
Change-Id: I5fea51faba40430106c823275a6356e81709d118
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
Diffstat (limited to 'src/plugins/cnat/cnat_types.c')
-rw-r--r-- | src/plugins/cnat/cnat_types.c | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/src/plugins/cnat/cnat_types.c b/src/plugins/cnat/cnat_types.c index b09459d8a14..084a03da968 100644 --- a/src/plugins/cnat/cnat_types.c +++ b/src/plugins/cnat/cnat_types.c @@ -16,8 +16,7 @@ #include <cnat/cnat_types.h> cnat_main_t cnat_main; -fib_source_t cnat_fib_source; -cnat_timestamp_t *cnat_timestamps; +cnat_timestamp_mpool_t cnat_timestamps; char *cnat_error_strings[] = { #define cnat_error(n,s) s, @@ -152,19 +151,6 @@ format_cnat_endpoint (u8 * s, va_list * args) return (s); } -static clib_error_t * -cnat_types_init (vlib_main_t * vm) -{ - cnat_fib_source = fib_source_allocate ("cnat", - CNAT_FIB_SOURCE_PRIORITY, - FIB_SOURCE_BH_SIMPLE); - - - clib_rwlock_init (&cnat_main.ts_lock); - - return (NULL); -} - void cnat_enable_disable_scanner (cnat_scanner_cmd_t event_type) { @@ -258,7 +244,6 @@ cnat_get_main () } VLIB_EARLY_CONFIG_FUNCTION (cnat_config, "cnat"); -VLIB_INIT_FUNCTION (cnat_types_init); /* * fd.io coding-style-patch-verification: ON |