aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/nat.h
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2020-04-22 12:45:50 +0000
committerOle Trøan <otroan@employees.org>2020-05-14 12:12:45 +0000
commit2a595da121b28784f73e710534522583cac7af40 (patch)
treec43c09673183f6ab4a0cee0b2329458581bfc8ce /src/plugins/nat/nat.h
parent88120824acc299a0aec17ce4c208dbc8be394779 (diff)
nat: ED: store both thread&session idx in hash
By storing thread and session index in hash table we are able to skip multiple hash lookups in multi-worker scenario, which were used for handoff before. Also, by storing sesion index in vnet_buffer2, we can avoid repeating the lookup after handoff. Type: improvement Signed-off-by: Klement Sekera <ksekera@cisco.com> Change-Id: I406fb12f4e2dd8f4a5ca5d83d59dbc37e1af9abf
Diffstat (limited to 'src/plugins/nat/nat.h')
-rw-r--r--src/plugins/nat/nat.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/nat/nat.h b/src/plugins/nat/nat.h
index 7a4d020dcde..31072272293 100644
--- a/src/plugins/nat/nat.h
+++ b/src/plugins/nat/nat.h
@@ -454,7 +454,6 @@ typedef struct
clib_bihash_8_8_t in2out;
/* Endpoint dependent sessions lookup tables */
- clib_bihash_16_8_t out2in_ed;
clib_bihash_16_8_t in2out_ed;
/* Find-a-user => src address lookup */
@@ -544,6 +543,9 @@ typedef struct snat_main_s
/* Static mapping pool */
snat_static_mapping_t *static_mappings;
+ /* Endpoint-dependent out2in mappings */
+ clib_bihash_16_8_t out2in_ed;
+
/* Interface pool */
snat_interface_t *interfaces;
snat_interface_t *output_feature_interfaces;
@@ -1288,6 +1290,8 @@ void nat44_db_init (snat_main_per_thread_data_t * tsm);
*/
void nat44_db_free (snat_main_per_thread_data_t * tsm);
+void nat44_sessions_clear ();
+
/**
* @brief Find or create NAT user
*