aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session.c
diff options
context:
space:
mode:
authorSteven Luong <sluong@cisco.com>2022-10-17 10:39:06 -0700
committerFlorin Coras <florin.coras@gmail.com>2022-10-20 15:16:08 +0000
commit20de85b6da7e0b6dd0d73bc8358e7c67564d0c36 (patch)
tree4a8085c84ae1cb2796c56ba929d31649875281a2 /src/vnet/session/session.c
parent049dee954f6acfc21c15a1a2926f6fb36d58a3e1 (diff)
session: add session debug cli
- add session debug cli to enable fine control of which event logs are enable/disable with below syntax session debug {show | group <list> level <n>} list may be entered with a dash, "0-4" or it may be entered with a comma, "0,1,4" - fix compilation errors when SESSION_EVT is enable - change SESSION_EVT_FREE_HANDLER to use DEC_SESSION_ED instead of DEC_SESSION_ETD because the transport may already be free when the handler is called Type: improvement Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: Iab2989e0a847bb59002ef16494eebcc1d112b2ae
Diffstat (limited to 'src/vnet/session/session.c')
-rw-r--r--src/vnet/session/session.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c
index 54d9b22c838..4c57b1ac9bb 100644
--- a/src/vnet/session/session.c
+++ b/src/vnet/session/session.c
@@ -216,15 +216,12 @@ session_alloc (u32 thread_index)
void
session_free (session_t * s)
{
- if (CLIB_DEBUG)
- {
- u8 thread_index = s->thread_index;
- clib_memset (s, 0xFA, sizeof (*s));
- pool_put (session_main.wrk[thread_index].sessions, s);
- return;
- }
+ session_worker_t *wrk = &session_main.wrk[s->thread_index];
+
SESSION_EVT (SESSION_EVT_FREE, s);
- pool_put (session_main.wrk[s->thread_index].sessions, s);
+ if (CLIB_DEBUG)
+ clib_memset (s, 0xFA, sizeof (*s));
+ pool_put (wrk->sessions, s);
}
u8