aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/nat.h
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2020-05-04 09:56:58 +0000
committerOle Trøan <otroan@employees.org>2020-05-13 11:39:30 +0000
commita3a830484fa6b6487f7f3d991a52cb6b090a8be8 (patch)
tree3b833401c46da712228b0c1194b9f6c3b80b0ffa /src/plugins/nat/nat.h
parentbc752e432ff3e252f6e1a3f0372c9532f14909cd (diff)
nat: fix LRU blocked by inactive session
This fixes a situation where long-lived inactive session blocks LRU list. Solution is to have multiple LRU lists based on session type. This helps because session timeout is same for all sessions of same type. Type: fix Signed-off-by: Klement Sekera <ksekera@cisco.com> Change-Id: I5e54b2aab73b23911d6518d42e8c3f166c69a38c
Diffstat (limited to 'src/plugins/nat/nat.h')
-rw-r--r--src/plugins/nat/nat.h28
1 files changed, 10 insertions, 18 deletions
diff --git a/src/plugins/nat/nat.h b/src/plugins/nat/nat.h
index e4f7a06ead8..7a4d020dcde 100644
--- a/src/plugins/nat/nat.h
+++ b/src/plugins/nat/nat.h
@@ -264,8 +264,10 @@ typedef CLIB_PACKED(struct
u32 per_user_index;
u32 per_user_list_head_index;
+ /* head of LRU list in which this session is tracked */
+ u32 lru_head_index;
/* index in global LRU list */
- u32 global_lru_index;
+ u32 lru_index;
f64 last_lru_update;
/* Last heard timer */
@@ -290,7 +292,7 @@ typedef CLIB_PACKED(struct
u8 state;
u32 i2o_fin_seq;
u32 o2i_fin_seq;
- u32 tcp_close_timestamp;
+ u64 tcp_closed_timestamp;
/* user index */
u32 user_index;
@@ -468,8 +470,12 @@ typedef struct
dlist_elt_t *list_pool;
/* LRU session list - head is stale, tail is fresh */
- dlist_elt_t *global_lru_pool;
- u32 global_lru_head_index;
+ dlist_elt_t *lru_pool;
+ u32 tcp_trans_lru_head_index;
+ u32 tcp_estab_lru_head_index;
+ u32 udp_lru_head_index;
+ u32 icmp_lru_head_index;
+ u32 unk_proto_lru_head_index;
/* NAT thread index */
u32 snat_thread_index;
@@ -1311,18 +1317,6 @@ snat_session_t *nat_session_alloc_or_recycle (snat_main_t * sm,
u32 thread_index, f64 now);
/**
- * @brief Allocate NAT endpoint-dependent session
- *
- * @param sm snat global configuration data
- * @param thread_index thread index
- * @param now time now
- *
- * @return session data structure on success otherwise zero value
- */
-snat_session_t *nat_ed_session_alloc (snat_main_t * sm, u32 thread_index,
- f64 now);
-
-/**
* @brief Set address and port assignment algorithm for MAP-E CE
*
* @param psid Port Set Identifier value
@@ -1431,8 +1425,6 @@ 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