From ea72764204dac0a1ab6412bc27b758faead2ca10 Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Fri, 7 May 2021 19:39:43 -0700 Subject: session: use half-open sessions for vc establishment Use half-open sessions to track virtual circuit connection establishment. These sesssions can only be allocated and freed by the thread that allocates half-open connections (main). Consequently, they can only be freed on half-open cleanup notifications from transports. Goal is to simplify state tracking within the session layer but it's also a first step towards allowing builtin apps to track and cleanup outstanding connects. Type: improvement Signed-off-by: Florin Coras Change-Id: I8a535906d13eb7f8966deb82333839de80f8049f --- src/vnet/session/session_types.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/vnet/session/session_types.h') diff --git a/src/vnet/session/session_types.h b/src/vnet/session/session_types.h index c8b1d2eb001..2c3db5f18b5 100644 --- a/src/vnet/session/session_types.h +++ b/src/vnet/session/session_types.h @@ -148,13 +148,14 @@ typedef enum SESSION_N_STATES, } session_state_t; -#define foreach_session_flag \ - _(RX_EVT, "rx-event") \ - _(PROXY, "proxy") \ - _(CUSTOM_TX, "custom-tx") \ - _(IS_MIGRATING, "migrating") \ - _(UNIDIRECTIONAL, "unidirectional") \ - _(CUSTOM_FIFO_TUNING, "custom-fifo-tuning") \ +#define foreach_session_flag \ + _ (RX_EVT, "rx-event") \ + _ (PROXY, "proxy") \ + _ (CUSTOM_TX, "custom-tx") \ + _ (IS_MIGRATING, "migrating") \ + _ (UNIDIRECTIONAL, "unidirectional") \ + _ (CUSTOM_FIFO_TUNING, "custom-fifo-tuning") \ + _ (HALF_OPEN, "half-open") typedef enum session_flags_bits_ { @@ -208,6 +209,9 @@ typedef struct session_ /** App listener index in app's listener pool if a listener */ u32 al_index; + + /** Index in app worker's half-open table if a half-open */ + u32 ho_index; }; /** Opaque, for general use */ -- cgit 1.2.3-korg