session: add flag to track cless sessions
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I0bb6aba26f1cd974d6bb3b5fe6234aacfee0d30c
This commit is contained in:
@@ -705,7 +705,7 @@ session_main_flush_enqueue_events (transport_proto_t transport_proto,
|
||||
session_worker_t *wrk = session_main_get_worker (thread_index);
|
||||
session_handle_t *handles;
|
||||
session_t *s;
|
||||
u32 i;
|
||||
u32 i, is_cl;
|
||||
|
||||
handles = wrk->session_to_enqueue[transport_proto];
|
||||
|
||||
@@ -714,8 +714,12 @@ session_main_flush_enqueue_events (transport_proto_t transport_proto,
|
||||
s = session_get_from_handle (handles[i]);
|
||||
session_fifo_tuning (s, s->rx_fifo, SESSION_FT_ACTION_ENQUEUED,
|
||||
0 /* TODO/not needed */);
|
||||
session_enqueue_notify_inline (s,
|
||||
s->thread_index != thread_index ? 1 : 0);
|
||||
is_cl =
|
||||
s->thread_index != thread_index || (s->flags & SESSION_F_IS_CLESS);
|
||||
if (!is_cl)
|
||||
session_enqueue_notify_inline (s, 0);
|
||||
else
|
||||
session_enqueue_notify_inline (s, 1);
|
||||
}
|
||||
|
||||
vec_reset_length (handles);
|
||||
@@ -1345,6 +1349,8 @@ session_open_cl (session_endpoint_cfg_t *rmt, session_handle_t *rsh)
|
||||
s->app_wrk_index = app_wrk->wrk_index;
|
||||
s->opaque = rmt->opaque;
|
||||
session_set_state (s, SESSION_STATE_OPENED);
|
||||
if (transport_connection_is_cless (tc))
|
||||
s->flags |= SESSION_F_IS_CLESS;
|
||||
if (app_worker_init_connected (app_wrk, s))
|
||||
{
|
||||
session_free (s);
|
||||
@@ -1470,6 +1476,8 @@ session_listen (session_t * ls, session_endpoint_cfg_t * sep)
|
||||
ls = listen_session_get (s_index);
|
||||
ls->connection_index = tc_index;
|
||||
ls->opaque = sep->opaque;
|
||||
if (transport_connection_is_cless (session_get_transport (ls)))
|
||||
ls->flags |= SESSION_F_IS_CLESS;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -174,7 +174,8 @@ typedef enum
|
||||
_ (UNIDIRECTIONAL, "unidirectional") \
|
||||
_ (CUSTOM_FIFO_TUNING, "custom-fifo-tuning") \
|
||||
_ (HALF_OPEN, "half-open") \
|
||||
_ (APP_CLOSED, "app-closed")
|
||||
_ (APP_CLOSED, "app-closed") \
|
||||
_ (IS_CLESS, "connectionless")
|
||||
|
||||
typedef enum session_flags_bits_
|
||||
{
|
||||
|
Reference in New Issue
Block a user