summaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/nat.h
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2020-04-09 13:31:27 +0200
committerOle Trøan <otroan@employees.org>2020-04-24 13:51:38 +0000
commit69de9fadbfd2e6e256a5133513e002712705ded3 (patch)
tree84c17fb37b5b9b08bb99c99e63351327095f1196 /src/plugins/nat/nat.h
parente7f420177620868275add23ba5fcea7c7d18c91a (diff)
nat: ED: reduce number of hash tables used
Use out2in_ed hash table for port overloading tracking instead of global table. This reduces number of hash insertions in slowpath. Type: improvement Change-Id: Iad4e897d52033beb7f6d76a7ddb596eef586c6cb Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'src/plugins/nat/nat.h')
-rw-r--r--src/plugins/nat/nat.h25
1 files changed, 2 insertions, 23 deletions
diff --git a/src/plugins/nat/nat.h b/src/plugins/nat/nat.h
index be82ced4318..4b9f24308f5 100644
--- a/src/plugins/nat/nat.h
+++ b/src/plugins/nat/nat.h
@@ -555,27 +555,6 @@ typedef int (nat_alloc_out_addr_and_port_function_t) (snat_address_t *
u16 port_per_thread,
u32 snat_thread_index);
-typedef struct ed_bihash_key_s
-{
- u32 src_address;
- u32 dst_address;
- u16 src_port;
- u16 dst_port;
- u8 protocol;
-} ed_bihash_key_t;
-
-typedef struct ed_bihash_kv_s
-{
- union
- {
- ed_bihash_key_t k;
- clib_bihash_kv_16_8_t kv;
- };
-} ed_bihash_kv_t;
-
-STATIC_ASSERT (STRUCT_SIZE_OF (ed_bihash_kv_t, k) <=
- STRUCT_SIZE_OF (ed_bihash_kv_t, kv.key),
- "ed key needs to fit in bihash key");
typedef struct snat_main_s
{
@@ -729,8 +708,6 @@ typedef struct snat_main_s
ip4_main_t *ip4_main;
ip_lookup_main_t *ip4_lookup_main;
api_main_t *api_main;
-
- clib_bihash_16_8_t ed_ext_ports;
} snat_main_t;
typedef struct
@@ -1465,6 +1442,8 @@ typedef struct
u16 src_port, dst_port;
} tcp_udp_header_t;
+int nat_global_lru_free_one (snat_main_t * sm, int thread_index, f64 now);
+
#endif /* __included_nat_h__ */
/*
* fd.io coding-style-patch-verification: ON