FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
session_node.c File Reference
+ Include dependency graph for session_node.c:

Go to the source code of this file.

Data Structures

struct  session_queue_trace_t
 

Macros

#define app_check_thread_and_barrier(_fn, _arg)
 
#define foreach_session_queue_error
 

Enumerations

enum  session_queue_error_t { SESSION_QUEUE_N_ERROR }
 
enum  { SESSION_TX_NO_BUFFERS = -2, SESSION_TX_NO_DATA, SESSION_TX_OK }
 

Functions

static void session_wrk_timerfd_update (session_worker_t *wrk, u64 time_ns)
 
static u64 session_wrk_tfd_timeout (session_wrk_state_t state, u32 thread_index)
 
static void session_wrk_set_state (session_worker_t *wrk, session_wrk_state_t state)
 
static transport_endpt_ext_cfg_tsession_mq_get_ext_config (application_t *app, uword offset)
 
static void session_mq_free_ext_config (application_t *app, uword offset)
 
static void session_mq_listen_handler (void *data)
 
static void session_mq_listen_uri_handler (void *data)
 
static void session_mq_connect_one (session_connect_msg_t *mp)
 
static void session_mq_handle_connects_rpc (void *arg)
 
static void session_mq_connect_handler (session_worker_t *wrk, session_evt_elt_t *elt)
 
static void session_mq_connect_uri_handler (void *data)
 
static void session_mq_shutdown_handler (void *data)
 
static void session_mq_disconnect_handler (void *data)
 
static void app_mq_detach_handler (void *data)
 
static void session_mq_unlisten_rpc (session_unlisten_msg_t *mp)
 
static void session_mq_unlisten_handler (session_worker_t *wrk, session_evt_elt_t *elt)
 
static void session_mq_accepted_reply_handler (void *data)
 
static void session_mq_reset_reply_handler (void *data)
 
static void session_mq_disconnected_handler (void *data)
 
static void session_mq_disconnected_reply_handler (void *data)
 
static void session_mq_worker_update_handler (void *data)
 
static void session_mq_app_wrk_rpc_handler (void *data)
 
static void session_mq_transport_attr_handler (void *data)
 
static u8format_session_queue_trace (u8 *s, va_list *args)
 
static void session_tx_trace_frame (vlib_main_t *vm, vlib_node_runtime_t *node, u32 next_index, u32 *to_next, u16 n_segs, session_t *s, u32 n_trace)
 
static void session_tx_fifo_chain_tail (vlib_main_t *vm, session_tx_context_t *ctx, vlib_buffer_t *b, u16 *n_bufs, u8 peek_data)
 
static void session_tx_fill_buffer (vlib_main_t *vm, session_tx_context_t *ctx, vlib_buffer_t *b, u16 *n_bufs, u8 peek_data)
 
static u8 session_tx_not_ready (session_t *s, u8 peek_data)
 
static transport_connection_tsession_tx_get_transport (session_tx_context_t *ctx, u8 peek_data)
 
static void session_tx_set_dequeue_params (vlib_main_t *vm, session_tx_context_t *ctx, u32 max_segs, u8 peek_data)
 
static void session_tx_maybe_reschedule (session_worker_t *wrk, session_tx_context_t *ctx, session_evt_elt_t *elt)
 
static int session_tx_fifo_read_and_snd_i (session_worker_t *wrk, vlib_node_runtime_t *node, session_evt_elt_t *elt, int *n_tx_packets, u8 peek_data)
 
int session_tx_fifo_peek_and_snd (session_worker_t *wrk, vlib_node_runtime_t *node, session_evt_elt_t *e, int *n_tx_packets)
 
int session_tx_fifo_dequeue_and_snd (session_worker_t *wrk, vlib_node_runtime_t *node, session_evt_elt_t *e, int *n_tx_packets)
 
int session_tx_fifo_dequeue_internal (session_worker_t *wrk, vlib_node_runtime_t *node, session_evt_elt_t *elt, int *n_tx_packets)
 
static session_tsession_event_get_session (session_worker_t *wrk, session_event_t *e)
 
static void session_event_dispatch_ctrl (session_worker_t *wrk, session_evt_elt_t *elt)
 
static void session_event_dispatch_io (session_worker_t *wrk, vlib_node_runtime_t *node, session_evt_elt_t *elt, int *n_tx_packets)
 
static void session_evt_add_to_list (session_worker_t *wrk, session_event_t *evt)
 
static void session_flush_pending_tx_buffers (session_worker_t *wrk, vlib_node_runtime_t *node)
 
int session_wrk_handle_mq (session_worker_t *wrk, svm_msg_q_t *mq)
 
static void session_wrk_update_state (session_worker_t *wrk)
 
static uword session_queue_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static clib_error_tsession_wrk_tfd_read_ready (clib_file_t *cf)
 
static clib_error_tsession_wrk_tfd_write_ready (clib_file_t *cf)
 
void session_wrk_enable_adaptive_mode (session_worker_t *wrk)
 
static clib_error_tsession_queue_exit (vlib_main_t *vm)
 
static uword session_queue_run_on_main (vlib_main_t *vm)
 
static uword session_queue_process (vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
 
static_always_inline uword session_queue_pre_input_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 

Variables

vlib_node_registration_t session_queue_node
 (constructor) VLIB_REGISTER_NODE (session_queue_node) More...
 
static char * session_queue_error_strings []
 
static const u32 session_evt_msg_sizes []
 
vlib_node_registration_t session_queue_process_node
 (constructor) VLIB_REGISTER_NODE (session_queue_process_node) More...
 
vlib_node_registration_t session_queue_pre_input_node
 (constructor) VLIB_REGISTER_NODE (session_queue_pre_input_node) More...
 

Macro Definition Documentation

◆ app_check_thread_and_barrier

#define app_check_thread_and_barrier (   _fn,
  _arg 
)
Value:
{ \
vlib_rpc_call_main_thread (_fn, (u8 *) _arg, sizeof(*_arg)); \
return; \
}

Definition at line 29 of file session_node.c.

◆ foreach_session_queue_error

#define foreach_session_queue_error
Value:
_(TX, "Packets transmitted") \
_(TIMER, "Timer events") \
_(NO_BUFFER, "Out of buffers")

Definition at line 797 of file session_node.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
SESSION_TX_NO_BUFFERS 
SESSION_TX_NO_DATA 
SESSION_TX_OK 

Definition at line 816 of file session_node.c.

◆ session_queue_error_t

Enumerator
SESSION_QUEUE_N_ERROR 

Definition at line 802 of file session_node.c.

Function Documentation

◆ app_mq_detach_handler()

static void app_mq_detach_handler ( void *  data)
static

Definition at line 373 of file session_node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_session_queue_trace()

static u8* format_session_queue_trace ( u8 s,
va_list *  args 
)
static

Definition at line 786 of file session_node.c.

◆ session_event_dispatch_ctrl()

static void session_event_dispatch_ctrl ( session_worker_t wrk,
session_evt_elt_t elt 
)
inlinestatic

Definition at line 1458 of file session_node.c.

+ Here is the call graph for this function:

◆ session_event_dispatch_io()

static void session_event_dispatch_io ( session_worker_t wrk,
vlib_node_runtime_t node,
session_evt_elt_t elt,
int *  n_tx_packets 
)
inlinestatic

Definition at line 1555 of file session_node.c.

+ Here is the call graph for this function:

◆ session_event_get_session()

static session_t* session_event_get_session ( session_worker_t wrk,
session_event_t *  e 
)
inlinestatic

Definition at line 1448 of file session_node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_evt_add_to_list()

static void session_evt_add_to_list ( session_worker_t wrk,
session_event_t *  evt 
)
inlinestatic

Definition at line 1623 of file session_node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_flush_pending_tx_buffers()

static void session_flush_pending_tx_buffers ( session_worker_t wrk,
vlib_node_runtime_t node 
)
static

Definition at line 1651 of file session_node.c.

+ Here is the call graph for this function:

◆ session_mq_accepted_reply_handler()

static void session_mq_accepted_reply_handler ( void *  data)
static

Definition at line 447 of file session_node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_mq_app_wrk_rpc_handler()

static void session_mq_app_wrk_rpc_handler ( void *  data)
static

Definition at line 705 of file session_node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_mq_connect_handler()

static void session_mq_connect_handler ( session_worker_t wrk,
session_evt_elt_t elt 
)
static

Definition at line 281 of file session_node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_mq_connect_one()

static void session_mq_connect_one ( session_connect_msg_t mp)
static

Definition at line 159 of file session_node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_mq_connect_uri_handler()

static void session_mq_connect_uri_handler ( void *  data)
static

Definition at line 314 of file session_node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_mq_disconnect_handler()

static void session_mq_disconnect_handler ( void *  data)
static

Definition at line 357 of file session_node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_mq_disconnected_handler()

static void session_mq_disconnected_handler ( void *  data)
static

Definition at line 554 of file session_node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_mq_disconnected_reply_handler()

static void session_mq_disconnected_reply_handler ( void *  data)
static

Definition at line 599 of file session_node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_mq_free_ext_config()

static void session_mq_free_ext_config ( application_t app,
uword  offset 
)
static

Definition at line 85 of file session_node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_mq_get_ext_config()

static transport_endpt_ext_cfg_t* session_mq_get_ext_config ( application_t app,
uword  offset 
)
static

Definition at line 74 of file session_node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_mq_handle_connects_rpc()

static void session_mq_handle_connects_rpc ( void *  arg)
static

Definition at line 205 of file session_node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_mq_listen_handler()

static void session_mq_listen_handler ( void *  data)
static

Definition at line 96 of file session_node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_mq_listen_uri_handler()

static void session_mq_listen_uri_handler ( void *  data)
static

Definition at line 135 of file session_node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_mq_reset_reply_handler()

static void session_mq_reset_reply_handler ( void *  data)
static

Definition at line 510 of file session_node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_mq_shutdown_handler()

static void session_mq_shutdown_handler ( void *  data)
static

Definition at line 341 of file session_node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_mq_transport_attr_handler()

static void session_mq_transport_attr_handler ( void *  data)
static

Definition at line 732 of file session_node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_mq_unlisten_handler()

static void session_mq_unlisten_handler ( session_worker_t wrk,
session_evt_elt_t elt 
)
static

Definition at line 428 of file session_node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_mq_unlisten_rpc()

static void session_mq_unlisten_rpc ( session_unlisten_msg_t mp)
static

Definition at line 391 of file session_node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_mq_worker_update_handler()

static void session_mq_worker_update_handler ( void *  data)
static

Definition at line 625 of file session_node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_queue_exit()

static clib_error_t* session_queue_exit ( vlib_main_t vm)
static

Definition at line 1880 of file session_node.c.

+ Here is the call graph for this function:

◆ session_queue_node_fn()

static uword session_queue_node_fn ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
static

Definition at line 1719 of file session_node.c.

+ Here is the caller graph for this function:

◆ session_queue_pre_input_inline()

static_always_inline uword session_queue_pre_input_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)

Definition at line 1952 of file session_node.c.

+ Here is the call graph for this function:

◆ session_queue_process()

static uword session_queue_process ( vlib_main_t vm,
vlib_node_runtime_t rt,
vlib_frame_t f 
)
static

Definition at line 1908 of file session_node.c.

+ Here is the call graph for this function:

◆ session_queue_run_on_main()

static uword session_queue_run_on_main ( vlib_main_t vm)
static

Definition at line 1899 of file session_node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_tx_fifo_chain_tail()

static void session_tx_fifo_chain_tail ( vlib_main_t vm,
session_tx_context_t ctx,
vlib_buffer_t b,
u16 n_bufs,
u8  peek_data 
)
inlinestatic

Definition at line 848 of file session_node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_tx_fifo_dequeue_and_snd()

int session_tx_fifo_dequeue_and_snd ( session_worker_t wrk,
vlib_node_runtime_t node,
session_evt_elt_t e,
int *  n_tx_packets 
)

Definition at line 1400 of file session_node.c.

+ Here is the call graph for this function:

◆ session_tx_fifo_dequeue_internal()

int session_tx_fifo_dequeue_internal ( session_worker_t wrk,
vlib_node_runtime_t node,
session_evt_elt_t elt,
int *  n_tx_packets 
)

Definition at line 1408 of file session_node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_tx_fifo_peek_and_snd()

int session_tx_fifo_peek_and_snd ( session_worker_t wrk,
vlib_node_runtime_t node,
session_evt_elt_t e,
int *  n_tx_packets 
)

Definition at line 1392 of file session_node.c.

+ Here is the call graph for this function:

◆ session_tx_fifo_read_and_snd_i()

static int session_tx_fifo_read_and_snd_i ( session_worker_t wrk,
vlib_node_runtime_t node,
session_evt_elt_t elt,
int *  n_tx_packets,
u8  peek_data 
)
inlinestatic

Definition at line 1187 of file session_node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_tx_fill_buffer()

static void session_tx_fill_buffer ( vlib_main_t vm,
session_tx_context_t ctx,
vlib_buffer_t b,
u16 n_bufs,
u8  peek_data 
)
inlinestatic

Definition at line 933 of file session_node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_tx_get_transport()

static transport_connection_t* session_tx_get_transport ( session_tx_context_t ctx,
u8  peek_data 
)
inlinestatic

Definition at line 1035 of file session_node.c.

+ Here is the caller graph for this function:

◆ session_tx_maybe_reschedule()

static void session_tx_maybe_reschedule ( session_worker_t wrk,
session_tx_context_t ctx,
session_evt_elt_t elt 
)
inlinestatic

Definition at line 1174 of file session_node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_tx_not_ready()

static u8 session_tx_not_ready ( session_t s,
u8  peek_data 
)
inlinestatic

Definition at line 1011 of file session_node.c.

+ Here is the caller graph for this function:

◆ session_tx_set_dequeue_params()

static void session_tx_set_dequeue_params ( vlib_main_t vm,
session_tx_context_t ctx,
u32  max_segs,
u8  peek_data 
)
inlinestatic

Definition at line 1055 of file session_node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_tx_trace_frame()

static void session_tx_trace_frame ( vlib_main_t vm,
vlib_node_runtime_t node,
u32  next_index,
u32 to_next,
u16  n_segs,
session_t s,
u32  n_trace 
)
static

Definition at line 824 of file session_node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_wrk_enable_adaptive_mode()

void session_wrk_enable_adaptive_mode ( session_worker_t wrk)

Definition at line 1860 of file session_node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_wrk_handle_mq()

int session_wrk_handle_mq ( session_worker_t wrk,
svm_msg_q_t mq 
)

Definition at line 1662 of file session_node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_wrk_set_state()

static void session_wrk_set_state ( session_worker_t wrk,
session_wrk_state_t  state 
)
inlinestatic

Definition at line 62 of file session_node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_wrk_tfd_read_ready()

static clib_error_t* session_wrk_tfd_read_ready ( clib_file_t cf)
static

Definition at line 1840 of file session_node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_wrk_tfd_timeout()

static u64 session_wrk_tfd_timeout ( session_wrk_state_t  state,
u32  thread_index 
)
inlinestatic

Definition at line 51 of file session_node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_wrk_tfd_write_ready()

static clib_error_t* session_wrk_tfd_write_ready ( clib_file_t cf)
static

Definition at line 1854 of file session_node.c.

+ Here is the caller graph for this function:

◆ session_wrk_timerfd_update()

static void session_wrk_timerfd_update ( session_worker_t wrk,
u64  time_ns 
)
static

Definition at line 37 of file session_node.c.

+ Here is the caller graph for this function:

◆ session_wrk_update_state()

static void session_wrk_update_state ( session_worker_t wrk)
static

Definition at line 1681 of file session_node.c.

+ Here is the call graph for this function:

Variable Documentation

◆ session_evt_msg_sizes

const u32 session_evt_msg_sizes[]
static
Initial value:
= {
#define _(symc, sym)
}

Definition at line 1614 of file session_node.c.

◆ session_queue_error_strings

char* session_queue_error_strings[]
static
Initial value:
= {
#define _(sym,string)
}

Definition at line 810 of file session_node.c.

◆ session_queue_node

vlib_node_registration_t session_queue_node
Initial value:
=
{
.function = session_queue_node_fn,
.name = "session-queue",
.format_trace = format_session_queue_trace,
.error_strings = session_queue_error_strings,
.state = VLIB_NODE_STATE_DISABLED,
}

(constructor) VLIB_REGISTER_NODE (session_queue_node)

Definition at line 776 of file session_node.c.

◆ session_queue_pre_input_node

vlib_node_registration_t session_queue_pre_input_node
Initial value:
=
{
.name = "session-queue-main",
.state = VLIB_NODE_STATE_DISABLED,
}

(constructor) VLIB_REGISTER_NODE (session_queue_pre_input_node)

Definition at line 1963 of file session_node.c.

◆ session_queue_process_node

vlib_node_registration_t session_queue_process_node
Initial value:
=
{
.function = session_queue_process,
.name = "session-queue-process",
.state = VLIB_NODE_STATE_DISABLED,
}

(constructor) VLIB_REGISTER_NODE (session_queue_process_node)

Definition at line 1942 of file session_node.c.

VLIB_NODE_TYPE_PRE_INPUT
@ VLIB_NODE_TYPE_PRE_INPUT
Definition: node.h:81
VLIB_NODE_TYPE_INPUT
@ VLIB_NODE_TYPE_INPUT
Definition: node.h:76
session_queue_node_fn
static uword session_queue_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: session_node.c:1719
session_queue_pre_input_inline
static_always_inline uword session_queue_pre_input_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: session_node.c:1952
session_queue_error_strings
static char * session_queue_error_strings[]
Definition: session_node.c:810
session_queue_process
static uword session_queue_process(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
Definition: session_node.c:1908
ARRAY_LEN
#define ARRAY_LEN(x)
Definition: clib.h:70
vlib_thread_is_main_w_barrier
static u8 vlib_thread_is_main_w_barrier(void)
Definition: threads.h:506
VLIB_NODE_FLAG_TRACE_SUPPORTED
#define VLIB_NODE_FLAG_TRACE_SUPPORTED
Definition: node.h:295
format_session_queue_trace
static u8 * format_session_queue_trace(u8 *s, va_list *args)
Definition: session_node.c:786
foreach_session_queue_error
#define foreach_session_queue_error
Definition: session_node.c:797
TX
@ TX
Definition: interface_types.api:79
VLIB_NODE_TYPE_PROCESS
@ VLIB_NODE_TYPE_PROCESS
Definition: node.h:84
foreach_session_ctrl_evt
#define foreach_session_ctrl_evt
Definition: session_types.h:365
u8
unsigned char u8
Definition: types.h:56