|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
50 evt->rpc_args.fp =
data;
51 evt->rpc_args.arg = args;
59 evt->session_index = *(
u32 *)
data;
73 evt->event_type = evt_type;
87 f->master_thread_index, evt_type);
122 void (*fnp) (
void *) = fp;
135 if (!(s->
flags & SESSION_F_CUSTOM_TX))
137 s->
flags |= SESSION_F_CUSTOM_TX;
149 elt->evt.session_index = tc->s_index;
169 elt->evt.session_index = tc->s_index;
191 elt->evt.event_type = evt;
256 (s->
flags & SESSION_F_HALF_OPEN))
309 if (ho->
flags & SESSION_F_IS_MIGRATING)
350 if (!tc->thread_index)
368 ho->
flags |= SESSION_F_IS_MIGRATING;
433 u32 to_drop = n_bytes_to_drop;
435 while (to_drop && (
next->flags & VLIB_BUFFER_NEXT_PRESENT))
438 if (
next->current_length > to_drop)
445 to_drop -=
next->current_length;
446 next->current_length = 0;
469 if (is_in_order &&
offset)
497 return (
rv > 0) ? (written +
rv) : written;
522 while ((chain_bi = (chain_b->
flags & VLIB_BUFFER_NEXT_PRESENT)
535 if (s->
flags & SESSION_F_CUSTOM_FIFO_TUNING)
544 ASSERT (
f->shr->size <= sm->max_fifo_size);
566 u8 queue_event,
u8 is_in_order)
569 int enqueued = 0,
rv, in_order_off;
606 if (!(s->
flags & SESSION_F_RX_EVT))
608 s->
flags |= SESSION_F_RX_EVT;
632 { (
u8 *) hdr,
sizeof (*hdr) },
648 seg->data = (
u8 *) hdr;
649 seg->len =
sizeof (*hdr);
654 seg->len =
it->current_length;
656 if (!(
it->flags & VLIB_BUFFER_NEXT_PRESENT))
665 if (queue_event &&
rv > 0)
672 if (!(s->
flags & SESSION_F_RX_EVT))
674 s->
flags |= SESSION_F_RX_EVT;
680 return rv > 0 ?
rv : 0;
718 for (
i = 0;
i <
f->shr->n_subscribers;
i++)
757 s->
flags &= ~SESSION_F_RX_EVT;
891 u32 opaque = 0, new_ti, new_si;
953 typedef struct _session_switch_pool_args
957 u32 new_thread_index;
958 u32 new_session_index;
975 s =
session_get (args->session_index, args->thread_index);
981 args->new_thread_index);
1022 new_s->
flags |= SESSION_F_IS_MIGRATING;
1043 rpc_args->session_index = tc->s_index;
1044 rpc_args->thread_index = old_thread_index;
1050 *new_session = new_s;
1094 case SESSION_STATE_CREATED:
1101 case SESSION_STATE_ACCEPTING:
1102 case SESSION_STATE_TRANSPORT_CLOSING:
1103 case SESSION_STATE_CLOSING:
1104 case SESSION_STATE_TRANSPORT_CLOSED:
1115 case SESSION_STATE_APP_CLOSED:
1127 case SESSION_STATE_TRANSPORT_DELETED:
1129 case SESSION_STATE_CLOSED:
1307 SESSION_DBG (
"Transport failed to open connection.");
1344 SESSION_DBG (
"Transport failed to open connection.");
1363 ho->
opaque = rmt->opaque;
1458 return SESSION_E_NOLISTEN;
1464 return SESSION_E_NONE;
1560 else if (s->
session_state >= SESSION_STATE_TRANSPORT_DELETED)
1587 else if (s->
session_state >= SESSION_STATE_TRANSPORT_DELETED)
1627 u32 evt_q_length = 2048, evt_size =
sizeof (session_event_t);
1629 uword eqs_size = 64 << 20;
1630 pid_t vpp_pid = getpid ();
1641 eqs->
ssvm.
name =
format (0,
"%s%c",
"session: evt-qs-segment", 0);
1660 {evt_q_length, evt_size, 0}
1662 {evt_q_length >> 1, 256, 0}
1715 if (output_node != ~0)
1796 u32 num_threads, preallocated_sessions_per_worker;
1806 if (num_threads < 1)
1812 for (
i = 0;
i < num_threads;
i++)
1825 if (num_threads > 1)
1841 if (num_threads == 1)
1848 preallocated_sessions_per_worker =
1850 (
f64) (num_threads - 1));
1852 for (j = 1; j < num_threads; j++)
1855 preallocated_sessions_per_worker);
1885 u8 mstate = is_en ? VLIB_NODE_STATE_INTERRUPT : VLIB_NODE_STATE_DISABLED;
1886 u8 state = is_en ? VLIB_NODE_STATE_POLLING : VLIB_NODE_STATE_DISABLED;
1893 for (
i = 0;
i < n_vlibs;
i++)
1897 if (
i == 0 && n_vlibs > 1)
1958 #if (HIGH_SEGMENT_BASEVA > (4ULL << 30))
1996 if (
unformat (input,
"event-queue-length %d", &nitems))
2001 clib_warning (
"event queue length %d too small, ignored", nitems);
2003 else if (
unformat (input,
"preallocated-sessions %d",
2006 else if (
unformat (input,
"v4-session-table-buckets %d",
2009 else if (
unformat (input,
"v4-halfopen-table-buckets %d",
2012 else if (
unformat (input,
"v6-session-table-buckets %d",
2015 else if (
unformat (input,
"v6-halfopen-table-buckets %d",
2018 else if (
unformat (input,
"v4-session-table-memory %U",
2021 if (
tmp >= 0x100000000)
2026 else if (
unformat (input,
"v4-halfopen-table-memory %U",
2029 if (
tmp >= 0x100000000)
2034 else if (
unformat (input,
"v6-session-table-memory %U",
2037 if (
tmp >= 0x100000000)
2042 else if (
unformat (input,
"v6-halfopen-table-memory %U",
2045 if (
tmp >= 0x100000000)
2050 else if (
unformat (input,
"local-endpoints-table-memory %U",
2053 if (
tmp >= 0x100000000)
2058 else if (
unformat (input,
"local-endpoints-table-buckets %d",
2062 else if (
unformat (input,
"evt_qs_memfd_seg"))
2067 else if (
unformat (input,
"enable"))
2071 else if (
unformat (input,
"use-app-socket-api"))
2073 else if (
unformat (input,
"poll-main"))
2075 else if (
unformat (input,
"use-private-rx-mqs"))
2077 else if (
unformat (input,
"no-adaptive"))
static void vlib_process_signal_event_mt(vlib_main_t *vm, uword node_index, uword type_opaque, uword data)
Signal event to process from any thread.
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
u32 next_buffer
Next buffer for this linked-list of buffers.
u32 n_rings
number of msg rings
void transport_cleanup(transport_proto_t tp, u32 conn_index, u8 thread_index)
static u8 svm_fifo_set_event(svm_fifo_t *f)
Set fifo event flag.
static u32 vlib_num_workers()
u32 wrk_index
Worker index in global worker pool.
u32 configured_v6_session_table_memory
session_fifo_rx_fn session_tx_fifo_dequeue_and_snd
void vlib_worker_thread_barrier_release(vlib_main_t *vm)
void sesssion_reschedule_tx(transport_connection_t *tc)
enum session_error_ session_error_t
static void session_cleanup_notify(session_t *s, session_cleanup_ntf_t ntf)
int session_enqueue_notify(session_t *s)
u8 session_enable_asap
Enable session manager at startup.
segment_manager_t * segment_manager_get(u32 index)
int session_lookup_del_connection(transport_connection_t *tc)
Delete transport connection from session table.
int session_dequeue_notify(session_t *s)
u32 session_index
Index in thread pool where session was allocated.
u8 transport_protocol_is_cl(transport_proto_t tp)
static uword vlib_node_add_next(vlib_main_t *vm, uword node, uword next_node)
@ SESSION_FT_ACTION_ENQUEUED
int() session_fifo_rx_fn(session_worker_t *wrk, vlib_node_runtime_t *node, session_evt_elt_t *e, int *n_tx_packets)
void svm_msg_q_add_and_unlock(svm_msg_q_t *mq, svm_msg_q_msg_t *msg)
Producer enqueue one message to queue with mutex held.
void session_transport_half_close(session_t *s)
Notify transport the session can be half-disconnected.
void session_close(session_t *s)
Initialize session closing procedure.
nat44_ei_hairpin_src_next_t next_index
static session_t * session_clone_safe(u32 session_index, u32 thread_index)
static void session_enqueue_discard_chain_bytes(vlib_main_t *vm, vlib_buffer_t *b, vlib_buffer_t **chain_b, u32 n_bytes_to_drop)
Discards bytes from buffer chain.
void session_transport_closing_notify(transport_connection_t *tc)
Notification from transport that connection is being closed.
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
static u8 svm_fifo_n_subscribers(svm_fifo_t *f)
Fifo number of subscribers getter.
int svm_fifo_enqueue_with_offset(svm_fifo_t *f, u32 offset, u32 len, u8 *src)
Enqueue a future segment.
svm_msg_q_msg_t svm_msg_q_alloc_msg_w_ring(svm_msg_q_t *mq, u32 ring_index)
Allocate message buffer on ring.
static uword pointer_to_uword(const void *p)
void session_half_open_delete_notify(transport_connection_t *tc)
void session_transport_cleanup(session_t *s)
Cleanup transport and session state.
int app_worker_add_half_open(app_worker_t *app_wrk, session_handle_t sh)
static void vlib_node_set_state(vlib_main_t *vm, u32 node_index, vlib_node_state_t new_state)
Set node dispatch state.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
void session_get_endpoint(session_t *s, transport_endpoint_t *tep, u8 is_lcl)
int timerfd
Timerfd used to periodically signal wrk session queue node.
#define CLIB_US_TIME_FREQ
void * svm_msg_q_msg_data(svm_msg_q_t *mq, svm_msg_q_msg_t *msg)
Get data for message in queue.
static int session_send_evt_to_thread(void *data, void *args, u32 thread_index, session_evt_type_t evt_type)
#define pool_get_aligned(P, E, A)
Allocate an object E from a pool P with alignment A.
static clib_error_t * session_config_fn(vlib_main_t *vm, unformat_input_t *input)
int svm_fifo_peek(svm_fifo_t *f, u32 offset, u32 len, u8 *dst)
Peek data from fifo.
static clib_error_t * session_manager_main_enable(vlib_main_t *vm)
static void clib_mem_free(void *p)
static u8 svm_fifo_needs_deq_ntf(svm_fifo_t *f, u32 n_last_deq)
Check if fifo needs dequeue notification.
u32 local_endpoints_table_memory
Transport table (preallocation) size parameters.
u64 session_segment_handle(session_t *s)
#define session_endpoint_to_transport_cfg(_sep)
u32 preallocated_sessions
Preallocate session config parameter.
struct _segment_manager segment_manager_t
#define clib_error_return(e, args...)
struct _session_endpoint_cfg session_endpoint_cfg_t
enum transport_service_type_ transport_service_type_t
pthread_t thread[MAX_CONNS]
static session_handle_t session_make_handle(u32 session_index, u32 data)
u32 transport_stop_listen(transport_proto_t tp, u32 conn_index)
struct _transport_proto_vft transport_proto_vft_t
u32 q_nitems
msg queue size (not rings)
@ SESSION_FT_ACTION_DEQUEUED
static session_t * listen_session_get(u32 ls_index)
void session_register_transport(transport_proto_t transport_proto, const transport_proto_vft_t *vft, u8 is_ip4, u32 output_node)
Initialize session layer for given transport proto and ip version.
int session_half_open_migrated_notify(transport_connection_t *tc)
#define APP_INVALID_INDEX
static int svm_msg_q_lock(svm_msg_q_t *mq)
Lock, or block trying, the message queue.
u8 thread_index
Index of the thread that allocated the session.
#define pool_put(P, E)
Free an object E in pool P.
session_type_t session_type
Type built from transport and network protocol types.
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
@ SESSION_IO_EVT_BUILTIN_TX
static void session_delete(session_t *s)
Cleans up session and lookup table.
vl_api_dhcp_client_state_t state
void session_transport_closed_notify(transport_connection_t *tc)
Notification from transport that it is closed.
void session_queue_run_on_main_thread(vlib_main_t *vm)
void transport_reset(transport_proto_t tp, u32 conn_index, u8 thread_index)
static u32 session_thread_from_handle(session_handle_t handle)
#define CLIB_ASSERT_ENABLE
u32 * session_type_to_next
Per session type output nodes.
int session_lookup_del_half_open(transport_connection_t *tc)
void app_namespaces_init(void)
struct _transport_connection transport_connection_t
void session_lookup_init(void)
void vlib_start_process(vlib_main_t *vm, uword process_index)
int app_worker_del_half_open(app_worker_t *app_wrk, session_t *s)
void session_free(session_t *s)
int session_open_app(session_endpoint_cfg_t *rmt, session_handle_t *rsh)
session_t * session_alloc_for_half_open(transport_connection_t *tc)
static void session_program_transport_ctrl_evt(session_t *s, session_evt_type_t evt)
static void clib_rwlock_writer_unlock(clib_rwlock_t *p)
clib_llist_index_t new_head
Head of list of elements.
int session_enqueue_dgram_connection(session_t *s, session_dgram_hdr_t *hdr, vlib_buffer_t *b, u8 proto, u8 queue_event)
u32 configured_v6_halfopen_table_buckets
static session_evt_elt_t * session_evt_alloc_new(session_worker_t *wrk)
int app_worker_reset_notify(app_worker_t *app_wrk, session_t *s)
session_worker_t * wrk
Worker contexts.
clib_time_type_t last_vlib_time
vlib_time_now last time around the track
#define pool_get_aligned_will_expand(P, YESNO, A)
See if pool_get will expand the pool or not.
session_t * session_alloc_for_connection(transport_connection_t *tc)
struct _svm_fifo svm_fifo_t
#define VLIB_CONFIG_FUNCTION(x, n,...)
int app_worker_cleanup_notify(app_worker_t *app_wrk, session_t *s, session_cleanup_ntf_t ntf)
void session_transport_close(session_t *s)
Notify transport the session can be disconnected.
@ SESSION_CLEANUP_TRANSPORT
application_t * application_get(u32 app_index)
u32 app_wrk_index
Index of the app worker that owns the session.
#define pool_init_fixed(pool, max_elts)
initialize a fixed-size, preallocated pool
int session_stream_accept(transport_connection_t *tc, u32 listener_index, u32 thread_index, u8 notify)
Accept a stream session.
int app_worker_init_connected(app_worker_t *app_wrk, session_t *s)
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
enum session_ft_action_ session_ft_action_t
svm_fifo_t * rx_fifo
Pointers to rx/tx buffers.
uword session_va_space_size
struct _session_switch_pool_args session_switch_pool_args_t
@ SESSION_IO_EVT_BUILTIN_RX
transport_proto_t session_add_transport_proto(void)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static u8 svm_msg_q_is_full(svm_msg_q_t *mq)
Check if message queue is full.
u32 app_index
Index of application that owns the listener.
#define vec_add2(V, P, N)
Add N elements to end of vector V, return pointer to new elements in P.
@ SESSION_CTRL_EVT_HALF_CLOSE
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
void session_node_enable_disable(u8 is_en)
void segment_manager_dealloc_fifos(svm_fifo_t *rx_fifo, svm_fifo_t *tx_fifo)
int session_enqueue_stream_connection(transport_connection_t *tc, vlib_buffer_t *b, u32 offset, u8 queue_event, u8 is_in_order)
u32 configured_event_queue_length
vpp fifo event queue configured length
static void svm_fifo_clear_deq_ntf(svm_fifo_t *f)
Clear the want notification flag and set has notification.
transport_connection_t * session_get_transport(session_t *s)
int session_listen(session_t *ls, session_endpoint_cfg_t *sep)
Ask transport to listen on session endpoint.
u32 ** session_to_enqueue
Per-proto vector of sessions to enqueue.
uword session_baseva
Session ssvm segment configs.
svm_msg_q_t * fifo_segment_msg_q_alloc(fifo_segment_t *fs, u32 mq_index, svm_msg_q_cfg_t *cfg)
Allocate message queue on segment.
int app_worker_close_notify(app_worker_t *app_wrk, session_t *s)
void transport_init(void)
#define vlib_worker_thread_barrier_sync(X)
session_fifo_rx_fn session_tx_fifo_peek_and_snd
static_always_inline uword vlib_get_thread_index(void)
int session_open_cl(session_endpoint_cfg_t *rmt, session_handle_t *rsh)
app_worker_t * app_worker_get_if_valid(u32 wrk_index)
void session_enqueue_notify_thread(session_handle_t sh)
Like session_enqueue_notify, but can be called from a thread that does not own the session.
int session_send_io_evt_to_thread_custom(void *data, u32 thread_index, session_evt_type_t evt_type)
static u32 vlib_get_buffer_index(vlib_main_t *vm, void *p)
Translate buffer pointer into buffer index.
void session_fifo_tuning(session_t *s, svm_fifo_t *f, session_ft_action_t act, u32 len)
int transport_connect(transport_proto_t tp, transport_endpoint_cfg_t *tep)
#define vec_validate_aligned(V, I, A)
Make sure vector is long enough for given index (no header, specified alignment)
session_fifo_rx_fn ** session_tx_fns
Per transport rx function that can either dequeue or peek.
int session_lookup_add_half_open(transport_connection_t *tc, u64 value)
int session_main_flush_all_enqueue_events(u8 transport_proto)
int session_stop_listen(session_t *s)
Ask transport to stop listening on local transport endpoint.
static void clib_rwlock_writer_lock(clib_rwlock_t *p)
clib_rwlock_t peekers_rw_locks
Peekers rw lock.
int session_dgram_accept(transport_connection_t *tc, u32 listener_index, u32 thread_index)
int svm_fifo_enqueue_segments(svm_fifo_t *f, const svm_fifo_seg_t segs[], u32 n_segs, u8 allow_partial)
Enqueue array of svm_fifo_seg_t in order.
@ SESSION_IO_EVT_TX_FLUSH
int(* session_open_service_fn)(session_endpoint_cfg_t *, session_handle_t *)
u32 configured_v6_halfopen_table_memory
static int session_enqueue_notify_inline(session_t *s)
Notify session peer that new data has been enqueued.
static u8 vlib_thread_is_main_w_barrier(void)
static session_evt_elt_t * session_evt_alloc_ctrl(session_worker_t *wrk)
static vlib_node_t * vlib_get_node(vlib_main_t *vm, u32 i)
Get vlib node by index.
session_main_t session_main
static u32 session_index_from_handle(session_handle_t handle)
void session_send_rpc_evt_to_thread(u32 thread_index, void *fp, void *rpc_args)
u32 configured_v4_session_table_buckets
Session table size parameters.
int svm_fifo_dequeue_drop(svm_fifo_t *f, u32 len)
Dequeue and drop bytes from fifo.
int session_open(session_endpoint_cfg_t *rmt, session_handle_t *rsh)
Ask transport to open connection to remote transport endpoint.
void session_debug_init(void)
static session_handle_t session_handle(session_t *s)
int session_main_flush_enqueue_events(u8 transport_proto, u32 thread_index)
Flushes queue of sessions that are to be notified of new data enqueued events.
int svm_fifo_enqueue(svm_fifo_t *f, u32 len, const u8 *src)
Enqueue data to fifo.
svm_msg_q_ring_cfg_t * ring_cfgs
array of ring cfgs
void session_half_open_migrate_notify(transport_connection_t *tc)
static session_t * session_get_from_handle(session_handle_t handle)
void session_cleanup_half_open(session_handle_t ho_handle)
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
int app_worker_init_accepted(session_t *s)
static u32 svm_fifo_max_dequeue_prod(svm_fifo_t *f)
Fifo max bytes to dequeue optimized for producer.
u8 is_enabled
Session manager is enabled.
u8 use_private_rx_mqs
Allocate private rx mqs for external apps.
save_rewrite_length must be aligned so that reass doesn t overwrite it
void session_reset(session_t *s)
Force a close without waiting for data to be flushed.
u8 is_initialized
Session manager initialized (not necessarily enabled)
#define CLIB_CACHE_LINE_BYTES
void transport_get_endpoint(transport_proto_t tp, u32 conn_index, u32 thread_index, transport_endpoint_t *tep, u8 is_lcl)
fifo_segment_t evt_qs_segment
Event queues memfd segment.
static session_t * session_get(u32 si, u32 thread_index)
void transport_cleanup_half_open(transport_proto_t tp, u32 conn_index)
u32 configured_v6_session_table_buckets
void transport_get_listener_endpoint(transport_proto_t tp, u32 conn_index, transport_endpoint_t *tep, u8 is_lcl)
void session_transport_delete_notify(transport_connection_t *tc)
Notification from transport that connection is being deleted.
int app_worker_connect_notify(app_worker_t *app_wrk, session_t *s, session_error_t err, u32 opaque)
static void clib_rwlock_init(clib_rwlock_t *p)
int session_send_ctrl_evt_to_thread(session_t *s, session_evt_type_t evt_type)
u16 current_length
Nbytes between current data and the end of this buffer.
clib_us_time_t last_vlib_us_time
vlib_time_now rounded to us precision and as u64
void svm_fifo_dequeue_drop_all(svm_fifo_t *f)
Drop all data from fifo.
svm_msg_q_t * vpp_event_queue
vpp event message queue for worker
session_handle_t listener_handle
Parent listener session index if the result of an accept.
static session_type_t session_type_from_proto_and_ip(transport_proto_t proto, u8 is_ip4)
static session_fifo_rx_fn * session_tx_fns[TRANSPORT_TX_N_FNS]
static clib_error_t * session_main_loop_init(vlib_main_t *vm)
ssvm_private_t ssvm
ssvm segment data
transport_proto_t last_transport_proto_type
session_evt_elt_t * event_elts
Pool of session event list elements.
#define session_endpoint_to_transport(_sep)
vlib_node_registration_t session_queue_process_node
(constructor) VLIB_REGISTER_NODE (session_queue_process_node)
#define vec_free(V)
Free vector's memory (no header).
template key/value backing page structure
@ TRANSPORT_CONNECTION_F_NO_LOOKUP
Don't register connection in lookup.
u32 session_tx_fifo_dequeue_drop(transport_connection_t *tc, u32 max_bytes)
fifo_segment_t * session_main_get_evt_q_segment(void)
static u32 svm_fifo_max_enqueue_prod(svm_fifo_t *f)
Maximum number of bytes that can be enqueued into fifo.
int session_open_vc(session_endpoint_cfg_t *rmt, session_handle_t *rsh)
int session_tx_fifo_peek_bytes(transport_connection_t *tc, u8 *buffer, u32 offset, u32 max_bytes)
int session_lookup_del_session(session_t *s)
u32 configured_v4_halfopen_table_memory
description fragment has unexpected format
int ssvm_server_init(ssvm_private_t *ssvm, ssvm_segment_type_t type)
#define SESSION_DBG(_fmt, _args...)
static session_t * session_get_if_valid(u64 si, u32 thread_index)
u32 opaque
Opaque, for general use.
@ SESSION_CLEANUP_SESSION
#define VLIB_INIT_FUNCTION(x)
transport_connection_t * listen_session_get_transport(session_t *s)
u32 transport_start_listen(transport_proto_t tp, u32 session_index, transport_endpoint_t *tep)
void transport_close(transport_proto_t tp, u32 conn_index, u8 thread_index)
static void vlib_node_set_interrupt_pending(vlib_main_t *vm, u32 node_index)
static session_t * ho_session_alloc(void)
int app_worker_lock_and_send_event(app_worker_t *app, session_t *s, u8 evt_type)
Send event to application.
enum _transport_proto transport_proto_t
app_worker_t * app_worker_get(u32 wrk_index)
vlib_main_t * vm
Convenience pointer to this worker's vlib_main.
static_always_inline uword clib_mem_get_page_size(void)
void session_half_close(session_t *s)
Initialize session half-closing procedure.
app_worker_t * application_get_worker(application_t *app, u32 wrk_map_index)
transport_service_type_t transport_protocol_service_type(transport_proto_t tp)
static vlib_main_t * vlib_get_main_by_index(u32 thread_index)
static void session_half_open_free(session_t *ho)
session_fifo_rx_fn session_tx_fifo_dequeue_internal
void session_transport_reset(session_t *s)
Force transport close.
void appns_sapi_enable(void)
void segment_manager_main_init(void)
#define SESSION_INVALID_HANDLE
static void session_enqueue_notify_rpc(void *arg)
clib_llist_index_t pending_connects
List of pending connects for first worker.
void transport_enable_disable(vlib_main_t *vm, u8 is_en)
static u8 transport_connection_is_descheduled(transport_connection_t *tc)
session_t * sessions
Worker session pool.
int fifo_segment_init(fifo_segment_t *fs)
Initialize fifo segment shared header.
int consumer_pid
pid of msg consumer
segment_manager_t * app_worker_get_connect_segment_manager(app_worker_t *)
static int session_enqueue_chain_tail(session_t *s, vlib_buffer_t *b, u32 offset, u8 is_in_order)
Enqueue buffer chain tail.
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
clib_llist_index_t old_head
Head of list of pending events.
u8 no_adaptive
Do not enable session queue node adaptive mode.
static u32 vlib_get_n_threads()
static transport_proto_t session_get_transport_proto(session_t *s)
static transport_connection_t * transport_get_connection(transport_proto_t tp, u32 conn_index, u8 thread_index)
static vlib_main_t * vlib_get_main(void)
int app_worker_session_fifo_tuning(app_worker_t *app_wrk, session_t *s, svm_fifo_t *f, session_ft_action_t act, u32 len)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
int app_worker_migrate_notify(app_worker_t *app_wrk, session_t *s, session_handle_t new_sh)
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
int app_worker_transport_closed_notify(app_worker_t *app_wrk, session_t *s)
#define uword_to_pointer(u, type)
void application_enable_rx_mqs_nodes(u8 is_en)
void session_vpp_event_queues_allocate(session_main_t *smm)
Allocate event queues in the shared-memory segment.
static transport_connection_t * transport_get_half_open(transport_proto_t tp, u32 conn_index)
static session_t * ho_session_get(u32 ho_index)
int session_lookup_add_connection(transport_connection_t *tc, u64 value)
Add transport connection to a session table.
#define clib_warning(format, args...)
#define HIGH_SEGMENT_BASEVA
u32 local_endpoints_table_buckets
int session_dgram_connect_notify(transport_connection_t *tc, u32 old_thread_index, session_t **new_session)
Move dgram session to the right thread.
static session_open_service_fn session_open_srv_fns[TRANSPORT_N_SERVICES]
int transport_connection_attribute(transport_proto_t tp, u32 conn_index, u8 thread_index, u8 is_get, transport_endpt_attr_t *attr)
u32 ho_index
Index in app worker's half-open table if a half-open.
void session_free_w_fifos(session_t *s)
static f64 vlib_time_now(vlib_main_t *vm)
static transport_connection_t * transport_get_listener(transport_proto_t tp, u32 conn_index)
u32 app_index
Index of owning app.
u8 poll_main
Poll session node in main thread.
session_wrk_state_t state
Worker state.
fifo_segment_header_t * h
fifo segment data
static u8 svm_msg_q_ring_is_full(svm_msg_q_t *mq, u32 ring_index)
clib_error_t * session_main_init(vlib_main_t *vm)
vlib_node_registration_t session_queue_node
(constructor) VLIB_REGISTER_NODE (session_queue_node)
static void session_half_open_free_rpc(void *args)
u32 configured_v4_session_table_memory
static int session_notify_subscribers(u32 app_index, session_t *s, svm_fifo_t *f, session_evt_type_t evt_type)
void session_transport_reset_notify(transport_connection_t *tc)
Notify application that connection has been reset.
static vlib_thread_main_t * vlib_get_thread_main()
static void session_switch_pool(void *cb_args)
Notify old thread of the session pool switch.
u32 total_length_not_including_first_buffer
Only valid for first buffer in chain.
void transport_half_close(transport_proto_t tp, u32 conn_index, u8 thread_index)
int session_transport_attribute(session_t *s, u8 is_get, transport_endpt_attr_t *attr)
int app_worker_accept_notify(app_worker_t *app_wrk, session_t *s)
@ TRANSPORT_CONNECTION_F_DESCHED
Connection descheduled by the session layer.
#define VLIB_MAIN_LOOP_ENTER_FUNCTION(x)
session_t * session_alloc(u32 thread_index)
int session_send_io_evt_to_thread(svm_fifo_t *f, session_evt_type_t evt_type)
volatile u8 session_state
State in session layer state machine.
static session_worker_t * session_main_get_worker(u32 thread_index)
void segment_manager_detach_fifo(segment_manager_t *sm, svm_fifo_t **f)
u32 connection_index
Index of the transport connection associated to the session.
static void * clib_mem_alloc(uword size)
void session_wrk_enable_adaptive_mode(session_worker_t *wrk)
u8 session_is_valid(u32 si, u8 thread_index)
u32 configured_v4_halfopen_table_buckets
#define clib_llist_make_head(LP, name)
Initialize llist head.
uword evt_qs_segment_size
static void session_switch_pool_reply(void *arg)
clib_error_t * vnet_session_enable_disable(vlib_main_t *vm, u8 is_en)
static void session_manager_main_disable(vlib_main_t *vm)
void segment_manager_attach_fifo(segment_manager_t *sm, svm_fifo_t **f, session_t *s)
void session_add_self_custom_tx_evt(transport_connection_t *tc, u8 has_prio)
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
int session_stream_accept_notify(transport_connection_t *tc)
int session_stream_connect_notify(transport_connection_t *tc, session_error_t err)
VLIB buffer representation.
void session_send_rpc_evt_to_thread_force(u32 thread_index, void *fp, void *rpc_args)
u64 segment_manager_make_segment_handle(u32 segment_manager_index, u32 segment_index)
clib_llist_index_t ctrl_head
Head of control events list.
#define SESSION_EVT(_evt, _args...)
static session_evt_elt_t * session_evt_alloc_old(session_worker_t *wrk)
static void svm_msg_q_unlock(svm_msg_q_t *mq)
Unlock message queue.