summaryrefslogtreecommitdiffstats
path: root/src/vnet/session
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-04-03 17:52:43 -0700
committerDamjan Marion <dmarion@me.com>2019-04-05 07:51:41 +0000
commit6416e6274d0817a347d5b54bc61b4f1b617ff363 (patch)
treed5cc8ad2ff1ea68d0656087e34c3d1407c23f874 /src/vnet/session
parent8509aa29e389bb57a7224d1ace0c55ba64db427b (diff)
tcp: do not delete session on establish pop
Also: - force reset if wait close pops in fin-wait-1 with unsent data - adds more event logging. Change-Id: I4ddada046214fa71e17514cdec57b3026f84a283 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session')
-rw-r--r--src/vnet/session/session.c10
-rw-r--r--src/vnet/session/session_debug.h17
2 files changed, 25 insertions, 2 deletions
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c
index f637d625616..9dc35238795 100644
--- a/src/vnet/session/session.c
+++ b/src/vnet/session/session.c
@@ -174,9 +174,15 @@ session_alloc (u32 thread_index)
void
session_free (session_t * s)
{
- pool_put (session_main.wrk[s->thread_index].sessions, s);
if (CLIB_DEBUG)
- clib_memset (s, 0xFA, sizeof (*s));
+ {
+ u8 thread_index = s->thread_index;
+ clib_memset (s, 0xFA, sizeof (*s));
+ pool_put (session_main.wrk[thread_index].sessions, s);
+ return;
+ }
+ SESSION_EVT_DBG (SESSION_EVT_FREE, s);
+ pool_put (session_main.wrk[s->thread_index].sessions, s);
}
void
diff --git a/src/vnet/session/session_debug.h b/src/vnet/session/session_debug.h
index 2912ae3828c..a26cd7f2636 100644
--- a/src/vnet/session/session_debug.h
+++ b/src/vnet/session/session_debug.h
@@ -25,6 +25,7 @@
_(POLL_GAP_TRACK, "poll gap track") \
_(POLL_DISPATCH_TIME, "dispatch time")\
_(DISPATCH_END, "dispatch end") \
+ _(FREE, "session free") \
typedef enum _session_evt_dbg
{
@@ -36,6 +37,7 @@ typedef enum _session_evt_dbg
#define SESSION_DEBUG 0 * (TRANSPORT_DEBUG > 0)
#define SESSION_DEQ_NODE_EVTS (0)
#define SESSION_EVT_POLL_DBG (0)
+#define SESSION_SM (0)
#if SESSION_DEBUG
@@ -57,6 +59,21 @@ typedef enum _session_evt_dbg
} * ed; \
ed = ELOG_DATA (&vlib_global_main.elog_main, _e)
+#if SESSION_SM
+#define SESSION_EVT_FREE_HANDLER(_s) \
+{ \
+ ELOG_TYPE_DECLARE (_e) = \
+ { \
+ .format = "free: idx %u", \
+ .format_args = "i4", \
+ }; \
+ DEC_SESSION_ETD(_s, _e, 1); \
+ ed->data[0] = _s->session_index; \
+}
+#else
+#define SESSION_EVT_FREE_HANDLER(_s)
+#endif
+
#if SESSION_DEQ_NODE_EVTS && SESSION_DEBUG > 1
#define SESSION_EVT_DEQ_HANDLER(_s, _body) \
{ \