From 2a595da121b28784f73e710534522583cac7af40 Mon Sep 17 00:00:00 2001 From: Klement Sekera Date: Wed, 22 Apr 2020 12:45:50 +0000 Subject: 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 Change-Id: I406fb12f4e2dd8f4a5ca5d83d59dbc37e1af9abf --- src/plugins/nat/nat44/inlines.h | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'src/plugins/nat/nat44') diff --git a/src/plugins/nat/nat44/inlines.h b/src/plugins/nat/nat44/inlines.h index 62121dfb0db..6e462d7c36f 100644 --- a/src/plugins/nat/nat44/inlines.h +++ b/src/plugins/nat/nat44/inlines.h @@ -64,28 +64,6 @@ nat44_session_reuse_old (snat_main_t * sm, snat_user_t * u, return s; } -static_always_inline void -nat44_sessions_clear () -{ - snat_main_t *sm = &snat_main; - snat_main_per_thread_data_t *tsm; - - /* *INDENT-OFF* */ - vec_foreach (tsm, sm->per_thread_data) - { - u32 ti; - - nat44_db_free (tsm); - nat44_db_init (tsm); - - ti = tsm->snat_thread_index; - // clear per thread session counters - vlib_set_simple_counter (&sm->total_users, ti, 0, 0); - vlib_set_simple_counter (&sm->total_sessions, ti, 0, 0); - } - /* *INDENT-ON* */ -} - static_always_inline void nat44_user_del_sessions (snat_user_t * u, u32 thread_index) { -- cgit 1.2.3-korg