summaryrefslogtreecommitdiffstats
path: root/plugins/snat-plugin/snat/snat.h
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/snat-plugin/snat/snat.h')
-rw-r--r--plugins/snat-plugin/snat/snat.h40
1 files changed, 31 insertions, 9 deletions
diff --git a/plugins/snat-plugin/snat/snat.h b/plugins/snat-plugin/snat/snat.h
index ca10b76adce..cb31dc51423 100644
--- a/plugins/snat-plugin/snat/snat.h
+++ b/plugins/snat-plugin/snat/snat.h
@@ -132,6 +132,17 @@ typedef struct {
} snat_interface_t;
typedef struct {
+ /* User pool */
+ snat_user_t * users;
+
+ /* Session pool */
+ snat_session_t * sessions;
+
+ /* Pool of doubly-linked list elements */
+ dlist_elt_t * list_pool;
+} snat_main_per_thread_data_t;
+
+typedef struct {
/* Main lookup tables */
clib_bihash_8_8_t out2in;
clib_bihash_8_8_t in2out;
@@ -139,18 +150,26 @@ typedef struct {
/* Find-a-user => src address lookup */
clib_bihash_8_8_t user_hash;
+ /* Non-translated packets worker lookup => src address + VRF */
+ clib_bihash_8_8_t worker_by_in;
+
+ /* Translated packets worker lookup => IP address + port number */
+ clib_bihash_8_8_t worker_by_out;
+
+ u32 num_workers;
+ u32 first_worker_index;
+ u32 next_worker;
+ u32 * workers;
+
+ /* Per thread data */
+ snat_main_per_thread_data_t * per_thread_data;
+
/* Find a static mapping by local */
clib_bihash_8_8_t static_mapping_by_local;
/* Find a static mapping by external */
clib_bihash_8_8_t static_mapping_by_external;
- /* User pool */
- snat_user_t * users;
-
- /* Session pool */
- snat_session_t * sessions;
-
/* Static mapping pool */
snat_static_mapping_t * static_mappings;
@@ -160,12 +179,13 @@ typedef struct {
/* Vector of outside addresses */
snat_address_t * addresses;
- /* Pool of doubly-linked list elements */
- dlist_elt_t * list_pool;
-
/* Randomize port allocation order */
u32 random_seed;
+ /* Worker handoff index */
+ u32 fq_in2out_index;
+ u32 fq_out2in_index;
+
/* Config parameters */
u8 static_mapping_only;
u8 static_mapping_connection_tracking;
@@ -196,6 +216,8 @@ extern vlib_node_registration_t snat_in2out_node;
extern vlib_node_registration_t snat_out2in_node;
extern vlib_node_registration_t snat_in2out_fast_node;
extern vlib_node_registration_t snat_out2in_fast_node;
+extern vlib_node_registration_t snat_in2out_worker_handoff_node;
+extern vlib_node_registration_t snat_out2in_worker_handoff_node;
void snat_free_outside_address_and_port (snat_main_t * sm,
snat_session_key_t * k,