37 u32 tries = 0, max_tries;
43 if (tries++ == max_tries)
61 evt->event_type = evt_type;
65 evt->rpc_args.fp = data;
66 evt->rpc_args.arg = args;
117 void (*fnp) (
void *) = fp;
127 session_event_t *evt;
163 s->session_index = s - wrk->
sessions;
164 s->thread_index = thread_index;
204 svm_fifo_t *server_rx_fifo = 0, *server_tx_fifo = 0;
205 u32 fifo_segment_index;
210 &fifo_segment_index)))
213 server_rx_fifo->master_session_index = s->session_index;
214 server_rx_fifo->master_thread_index = s->thread_index;
216 server_tx_fifo->master_session_index = s->session_index;
217 server_tx_fifo->master_thread_index = s->thread_index;
219 s->server_rx_fifo = server_rx_fifo;
220 s->server_tx_fifo = server_tx_fifo;
221 s->svm_segment_index = fifo_segment_index;
229 u32 thread_index = tc->thread_index;
236 s->enqueue_epoch = (
u64) ~ 0;
240 s->connection_index = tc->c_index;
241 tc->s_index = s->session_index;
278 u32 to_drop = n_bytes_to_drop;
280 while (to_drop && (next->
flags & VLIB_BUFFER_NEXT_PRESENT))
314 if (is_in_order && offset)
342 return (rv > 0) ? (written + rv) : written;
368 while ((chain_bi = (chain_b->
flags & VLIB_BUFFER_NEXT_PRESENT)
394 u8 queue_event,
u8 is_in_order)
397 int enqueued = 0, rv, in_order_off;
446 session_dgram_hdr_t * hdr,
449 int enqueued = 0, rv, in_order_off;
501 if (!s->server_tx_fifo)
511 return svm_fifo_peek (s->server_tx_fifo, offset, max_bytes, buffer);
537 SESSION_DBG (
"invalid s->app_index = %d", s->app_wrk_index);
585 for (i = 0; i <
vec_len (indices); i++)
621 u32 rx_pointer,
u32 tx_pointer)
632 u32 opaque = 0, new_ti, new_si;
658 opaque = tc->s_index;
676 new_s->app_wrk_index = app_wrk->
wrk_index;
677 new_si = new_s->session_index;
678 new_ti = new_s->thread_index;
685 if (app->
cb_fns.session_connected_callback (app_wrk->
wrk_index, opaque,
707 typedef struct _session_switch_pool_args
711 u32 new_thread_index;
712 u32 new_session_index;
722 s =
session_get (args->session_index, args->thread_index);
723 s->server_tx_fifo->master_session_index = args->new_session_index;
724 s->server_tx_fifo->master_thread_index = args->new_thread_index;
726 tp_vfts[tp].cleanup (s->connection_index, s->thread_index);
736 u32 old_thread_index,
746 new_s->connection_index = tc->c_index;
747 new_s->server_rx_fifo->master_session_index = new_s->session_index;
748 new_s->server_rx_fifo->master_thread_index = new_s->thread_index;
757 rpc_args->new_session_index = new_s->session_index;
758 rpc_args->new_thread_index = new_s->thread_index;
759 rpc_args->session_index = tc->s_index;
760 rpc_args->thread_index = old_thread_index;
764 tc->s_index = new_s->session_index;
765 new_s->connection_index = tc->c_index;
766 *new_session = new_s;
783 return app->
cb_fns.session_accept_callback (s);
808 app->
cb_fns.session_disconnect_callback (s);
831 switch (s->session_state)
916 app->
cb_fns.session_reset_callback (s);
940 s->listener_index = listener_index;
946 return app->
cb_fns.session_accept_callback (s);
964 rv =
tp_vfts[rmt->transport_proto].open (tep);
967 SESSION_DBG (
"Transport failed to open connection.");
968 return VNET_API_ERROR_SESSION_CONNECT;
971 tc =
tp_vfts[rmt->transport_proto].get_half_open ((
u32) rv);
985 app->
cb_fns.session_connected_callback (app_wrk->
wrk_index, opaque, s, 0);
999 rv =
tp_vfts[rmt->transport_proto].open (tep);
1002 SESSION_DBG (
"Transport failed to open connection.");
1003 return VNET_API_ERROR_SESSION_CONNECT;
1006 tc =
tp_vfts[rmt->transport_proto].get_half_open ((
u32) rv);
1015 handle = (((
u64) app_wrk_index) << 32) | (
u64) tc->c_index;
1021 tc->s_index = opaque;
1031 sep->app_wrk_index = app_wrk_index;
1032 sep->opaque = opaque;
1034 return tp_vfts[rmt->transport_proto].open (tep_cfg);
1080 u32 tc_index, s_index;
1084 s_index = ls->session_index;
1085 tc_index =
tp_vfts[sep->transport_proto].bind (s_index, tep);
1087 if (tc_index == (
u32) ~ 0)
1092 ls->connection_index = tc_index;
1095 tc =
tp_vfts[sep->transport_proto].get_listener (tc_index);
1116 tc =
tp_vfts[tp].get_listener (s->connection_index);
1120 return VNET_API_ERROR_ADDRESS_NOT_IN_USE;
1124 tp_vfts[tp].unbind (s->connection_index);
1244 u32 evt_q_length = 2048, evt_size =
sizeof (session_event_t);
1247 u64 eqs_size = 64 << 20;
1248 pid_t vpp_pid = getpid ();
1263 eqs->
name =
format (0,
"%s%c",
"evt-qs-segment", 0);
1282 {evt_q_length, evt_size, 0}
1284 {evt_q_length << 1, 256, 0}
1318 session_tx_fifo_dequeue_and_snd
1335 u32 next_index = ~0;
1343 if (output_node != ~0)
1364 return tp_vfts[tp].get_connection (s->connection_index,
1374 return tp_vfts[tp].get_listener (s->connection_index);
1383 tc =
tp_vfts[tp].get_listener (listener->connection_index);
1391 sep->port = tc->lcl_port;
1392 sep->transport_proto = tc->proto;
1393 sep->is_ip4 = tc->is_ip4;
1411 u32 num_threads, preallocated_sessions_per_worker;
1417 if (num_threads < 1)
1425 for (j = 0; j < num_threads; j++)
1429 for (i = 0; i < num_threads; i++)
1444 if (num_threads > 1)
1449 vec_validate (smm->last_event_poll_by_thread, num_threads - 1);
1463 if (num_threads == 1)
1470 preallocated_sessions_per_worker =
1472 (
f64) (num_threads - 1));
1474 for (j = 1; j < num_threads; j++)
1477 preallocated_sessions_per_worker);
1497 u8 state = is_en ? VLIB_NODE_STATE_POLLING : VLIB_NODE_STATE_DISABLED;
1503 if (have_workers && ii == 0)
1554 #if (HIGH_SEGMENT_BASEVA > (4ULL << 30)) 1576 if (
unformat (input,
"event-queue-length %d", &nitems))
1581 clib_warning (
"event queue length %d too small, ignored", nitems);
1583 else if (
unformat (input,
"preallocated-sessions %d",
1586 else if (
unformat (input,
"v4-session-table-buckets %d",
1589 else if (
unformat (input,
"v4-halfopen-table-buckets %d",
1592 else if (
unformat (input,
"v6-session-table-buckets %d",
1595 else if (
unformat (input,
"v6-halfopen-table-buckets %d",
1598 else if (
unformat (input,
"v4-session-table-memory %U",
1601 if (tmp >= 0x100000000)
1606 else if (
unformat (input,
"v4-halfopen-table-memory %U",
1609 if (tmp >= 0x100000000)
1614 else if (
unformat (input,
"v6-session-table-memory %U",
1617 if (tmp >= 0x100000000)
1622 else if (
unformat (input,
"v6-halfopen-table-memory %U",
1625 if (tmp >= 0x100000000)
1630 else if (
unformat (input,
"local-endpoints-table-memory %U",
1633 if (tmp >= 0x100000000)
1638 else if (
unformat (input,
"local-endpoints-table-buckets %d",
1641 else if (
unformat (input,
"evt_qs_memfd_seg"))
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
u32 configured_v4_session_table_memory
f64 dispatch_period
Our approximation of a "complete" dispatch loop period.
static session_open_service_fn session_open_srv_fns[TRANSPORT_N_SERVICES]
app_worker_t * app_worker_get(u32 wrk_index)
int stream_session_accept_notify(transport_connection_t *tc)
static void session_delete(stream_session_t *s)
Cleans up session and lookup table.
void session_flush_frames_main_thread(vlib_main_t *vm)
static u8 svm_msg_q_msg_is_invalid(svm_msg_q_msg_t *msg)
Check if message is invalid.
int session_lookup_del_connection(transport_connection_t *tc)
Delete transport connection from session table.
void * svm_msg_q_msg_data(svm_msg_q_t *mq, svm_msg_q_msg_t *msg)
Get data for message in queue.
static u8 svm_msg_q_ring_is_full(svm_msg_q_t *mq, u32 ring_index)
clib_rwlock_t peekers_rw_locks
Peekers rw lock.
int session_open(u32 app_wrk_index, session_endpoint_t *rmt, u32 opaque)
Ask transport to open connection to remote transport endpoint.
static void svm_pop_heap(void *oldheap)
void svm_fifo_init_pointers(svm_fifo_t *f, u32 pointer)
Set fifo pointers to requested offset.
#define SESSION_Q_PROCESS_FLUSH_FRAMES
static void clib_rwlock_writer_lock(clib_rwlock_t *p)
transport_proto_vft_t * tp_vfts
Per-type vector of transport protocol virtual function tables.
struct _transport_connection transport_connection_t
ssvm_private_t evt_qs_segment
Event queues memfd segment initialized only if so configured.
u32 configured_v4_halfopen_table_memory
u32 configured_v6_session_table_buckets
session_manager_main_t session_manager_main
void session_transport_delete_notify(transport_connection_t *tc)
Notification from transport that connection is being deleted.
static f64 vlib_time_now(vlib_main_t *vm)
app_worker_t * application_listener_select_worker(stream_session_t *ls, u8 is_local)
#define pool_get_aligned_will_expand(P, YESNO, A)
See if pool_get will expand the pool or not.
struct _transport_proto_vft transport_proto_vft_t
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
session_event_t * pending_event_vector
Vector of active event vectors.
void session_send_rpc_evt_to_thread(u32 thread_index, void *fp, void *rpc_args)
void session_transport_reset_notify(transport_connection_t *tc)
Notify application that connection has been reset.
#define vec_add2(V, P, N)
Add N elements to end of vector V, return pointer to new elements in P.
session_event_t * postponed_event_vector
Vector of postponed events.
#define session_endpoint_to_transport_cfg(_sep)
transport_tx_fn_type_t transport_protocol_tx_fn_type(transport_proto_t tp)
clib_memset(h->entries, 0, sizeof(h->entries[0])*entries)
int session_open_vc(u32 app_wrk_index, session_endpoint_t *rmt, u32 opaque)
void svm_fifo_dequeue_drop_all(svm_fifo_t *f)
transport_connection_t * session_get_transport(stream_session_t *s)
static u32 svm_fifo_max_enqueue(svm_fifo_t *f)
ssvm_shared_header_t * sh
int session_lookup_del_session(stream_session_t *s)
void segment_manager_dealloc_fifos(u32 segment_index, svm_fifo_t *rx_fifo, svm_fifo_t *tx_fifo)
u8 is_enabled
Session manager is enabled.
int session_listen(stream_session_t *ls, session_endpoint_cfg_t *sep)
Ask transport to listen on session endpoint.
#define vec_validate_aligned(V, I, A)
Make sure vector is long enough for given index (no header, specified alignment)
int session_enqueue_stream_connection(transport_connection_t *tc, vlib_buffer_t *b, u32 offset, u8 queue_event, u8 is_in_order)
u64 session_lookup_half_open_handle(transport_connection_t *tc)
u32 configured_v6_halfopen_table_memory
void session_node_enable_disable(u8 is_en)
vlib_node_registration_t session_queue_node
(constructor) VLIB_REGISTER_NODE (session_queue_node)
vlib_main_t ** vlib_mains
enum transport_service_type_ transport_service_type_t
static uword vlib_node_add_next(vlib_main_t *vm, uword node, uword next_node)
session_fifo_rx_fn session_tx_fifo_peek_and_snd
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
static session_fifo_rx_fn * session_tx_fns[TRANSPORT_TX_N_FNS]
session_event_t * pending_disconnects
Vector of postponed disconnects.
struct _svm_fifo svm_fifo_t
void session_free(stream_session_t *s)
segment_manager_t * app_worker_get_listen_segment_manager(app_worker_t *app, stream_session_t *listener)
int session_stop_listen(stream_session_t *s)
Ask transport to stop listening on local transport endpoint.
void session_transport_closing_notify(transport_connection_t *tc)
Notification from transport that connection is being closed.
int session_open_cl(u32 app_wrk_index, session_endpoint_t *rmt, u32 opaque)
static svm_msg_q_t * session_manager_get_vpp_event_queue(u32 thread_index)
void app_namespaces_init(void)
static clib_error_t * session_config_fn(vlib_main_t *vm, unformat_input_t *input)
svm_msg_q_t * svm_msg_q_alloc(svm_msg_q_cfg_t *cfg)
Allocate message queue.
#define VLIB_INIT_FUNCTION(x)
u32 * session_to_enqueue[TRANSPORT_N_PROTO]
Per-proto vector of sessions to enqueue.
static void * svm_push_data_heap(svm_region_t *rp)
static u32 svm_fifo_max_dequeue(svm_fifo_t *f)
int session_send_ctrl_evt_to_thread(stream_session_t *s, session_evt_type_t evt_type)
static stream_session_t * session_alloc_for_connection(transport_connection_t *tc)
int session_dequeue_notify(stream_session_t *s)
static stream_session_t * listen_session_get(u32 index)
static void * ssvm_push_heap(ssvm_shared_header_t *sh)
#define clib_error_return(e, args...)
svm_region_t * vlib_rp
Current binary api segment descriptor.
int svm_fifo_enqueue_nowait(svm_fifo_t *f, u32 max_bytes, const u8 *copy_from_here)
vhost_vring_state_t state
int session_enqueue_dgram_connection(stream_session_t *s, session_dgram_hdr_t *hdr, vlib_buffer_t *b, u8 proto, u8 queue_event)
u32 configured_v6_session_table_memory
struct _stream_session_t stream_session_t
int session_send_io_evt_to_thread(svm_fifo_t *f, session_evt_type_t evt_type)
void session_vpp_event_queues_allocate(session_manager_main_t *smm)
Allocate event queues in the shared-memory segment.
int ssvm_master_init(ssvm_private_t *ssvm, ssvm_segment_type_t type)
int( session_fifo_rx_fn)(vlib_main_t *vm, vlib_node_runtime_t *node, session_manager_worker_t *wrk, session_event_t *e, int *n_tx_pkts)
enum transport_dequeue_type_ transport_tx_fn_type_t
static void ssvm_pop_heap(void *oldheap)
void session_close(stream_session_t *s)
Initialize session closing procedure.
stream_session_t * sessions
Worker session pool.
int session_lookup_del_half_open(transport_connection_t *tc)
static u32 vlib_get_buffer_index(vlib_main_t *vm, void *p)
Translate buffer pointer into buffer index.
static clib_error_t * session_manager_main_enable(vlib_main_t *vm)
struct _session_endpoint_cfg session_endpoint_cfg_t
session_event_t * free_event_vector
Vector of partially read events.
#define session_endpoint_to_transport(_sep)
static transport_proto_t session_get_transport_proto(stream_session_t *s)
u32 stream_session_dequeue_drop(transport_connection_t *tc, u32 max_bytes)
int segment_manager_alloc_session_fifos(segment_manager_t *sm, svm_fifo_t **rx_fifo, svm_fifo_t **tx_fifo, u32 *fifo_segment_index)
f64 last_vlib_time
vlib_time_now last time around the track
int session_dgram_connect_notify(transport_connection_t *tc, u32 old_thread_index, stream_session_t **new_session)
Move dgram session to the right thread.
static void clib_rwlock_init(clib_rwlock_t *p)
int svm_msg_q_alloc_consumer_eventfd(svm_msg_q_t *mq)
Allocate event fd for queue consumer.
transport_service_type_t transport_protocol_service_type(transport_proto_t tp)
u16 current_length
Nbytes between current data and the end of this buffer.
struct _session_endpoint session_endpoint_t
static void svm_fifo_clear_tx_ntf(svm_fifo_t *f)
app_worker_t * app_worker_get_if_valid(u32 wrk_index)
u32 configured_v6_halfopen_table_buckets
static session_handle_t session_handle(stream_session_t *s)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
#define pool_put(P, E)
Free an object E in pool P.
#define VLIB_CONFIG_FUNCTION(x, n,...)
u32 wrk_index
Worker index in global worker pool.
clib_error_t * session_manager_main_init(vlib_main_t *vm)
static stream_session_t * session_get_if_valid(u64 si, u32 thread_index)
#define foreach_vlib_main(body)
int stream_session_accept(transport_connection_t *tc, u32 listener_index, u8 notify)
Accept a stream session.
clib_error_t * vnet_session_enable_disable(vlib_main_t *vm, u8 is_en)
void session_free_w_fifos(stream_session_t *s)
static stream_session_t * session_get(u32 si, u32 thread_index)
struct _session_switch_pool_args session_switch_pool_args_t
API main structure, used by both vpp and binary API clients.
int session_alloc_fifos(segment_manager_t *sm, stream_session_t *s)
#define pool_get_aligned(P, E, A)
Allocate an object E from a pool P with alignment A.
#define SESSION_DBG(_fmt, _args...)
static void clib_rwlock_writer_unlock(clib_rwlock_t *p)
u32 n_rings
number of msg rings
#define SESSION_EVT_DBG(_evt, _args...)
void transport_init(void)
session_fifo_rx_fn session_tx_fifo_dequeue_and_snd
static session_manager_worker_t * session_manager_get_worker(u32 thread_index)
static int session_enqueue_notify(stream_session_t *s)
Notify session peer that new data has been enqueued.
static_always_inline uword vlib_get_thread_index(void)
static vlib_process_t * vlib_get_current_process(vlib_main_t *vm)
static session_type_t session_type_from_proto_and_ip(transport_proto_t proto, u8 is_ip4)
static void svm_msg_q_unlock(svm_msg_q_t *mq)
Unlock message queue.
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.
void session_transport_cleanup(stream_session_t *s)
Cleanup transport and session state.
transport_service_type_t session_transport_service_type(stream_session_t *s)
#define clib_warning(format, args...)
void transport_init_tx_pacers_period(void)
Initialize period for tx pacers.
static int session_send_evt_to_thread(void *data, void *args, u32 thread_index, session_evt_type_t evt_type)
void stream_session_init_fifos_pointers(transport_connection_t *tc, u32 rx_pointer, u32 tx_pointer)
Init fifo tail and head pointers.
#define HIGH_SEGMENT_BASEVA
void session_transport_close(stream_session_t *s)
Notify transport the session can be disconnected.
void transport_enable_disable(vlib_main_t *vm, u8 is_en)
static u8 vlib_thread_is_main_w_barrier(void)
static int svm_msg_q_try_lock(svm_msg_q_t *mq)
Try locking message queue.
u32 configured_v4_halfopen_table_buckets
u32 local_endpoints_table_buckets
#define pool_init_fixed(pool, max_elts)
initialize a fixed-size, preallocated pool
application_t * application_get(u32 app_index)
int app_worker_lock_and_send_event(app_worker_t *app, stream_session_t *s, u8 evt_type)
Send event to application.
#define SESSION_Q_PROCESS_STOP
session_fifo_rx_fn ** session_tx_fns
Per transport rx function that can either dequeue or peek.
ssvm_private_t * session_manager_get_evt_q_segment(void)
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.
u32 session_tx_fifo_max_dequeue(transport_connection_t *tc)
u32 preallocated_sessions
Preallocate session config parameter.
u32 next_buffer
Next buffer for this linked-list of buffers.
void segment_manager_main_init(segment_manager_main_init_args_t *a)
static void clib_mem_free(void *p)
session_cb_vft_t cb_fns
Callbacks: shoulder-taps for the server/client.
int listen_session_get_local_session_endpoint(stream_session_t *listener, session_endpoint_t *sep)
u32 * session_type_to_next
Per session type output nodes.
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
static void vlib_node_set_state(vlib_main_t *vm, u32 node_index, vlib_node_state_t new_state)
Set node dispatch state.
int svm_fifo_enqueue_with_offset(svm_fifo_t *f, u32 offset, u32 required_bytes, u8 *copy_from_here)
static void * clib_mem_alloc(uword size)
svm_msg_q_ring_cfg_t * ring_cfgs
array of ring cfgs
static vlib_main_t * vlib_get_main(void)
stream_session_t * session_alloc(u32 thread_index)
#define HALF_OPEN_LOOKUP_INVALID_VALUE
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.
u32 total_length_not_including_first_buffer
Only valid for first buffer in chain.
template key/value backing page structure
u32 configured_v4_session_table_buckets
Session table size parameters.
static void session_switch_pool(void *cb_args)
int svm_fifo_dequeue_drop(svm_fifo_t *f, u32 max_bytes)
u64 current_enqueue_epoch[TRANSPORT_N_PROTO]
Per-proto enqueue epoch counters.
session_manager_worker_t * wrk
Worker contexts.
u32 q_nitems
msg queue size (not rings)
enum _transport_proto transport_proto_t
transport_connection_t * listen_session_get_transport(stream_session_t *s)
void session_lookup_init(void)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
svm_msg_q_t * vpp_event_queue
vpp event message queue for worker
session_fifo_rx_fn session_tx_fifo_dequeue_internal
uword session_baseva
Session ssvm segment configs.
static stream_session_t * session_clone_safe(u32 session_index, u32 thread_index)
void session_transport_closed_notify(transport_connection_t *tc)
Notification from transport that session can be closed.
struct _segment_manager segment_manager_t
int session_send_io_evt_to_thread_custom(void *data, u32 thread_index, session_evt_type_t evt_type)
int session_manager_flush_all_enqueue_events(u8 transport_proto)
u32 app_index
Index of owning app.
int session_lookup_add_connection(transport_connection_t *tc, u64 value)
Add transport connection to a session table.
transport_tx_fn_type_t session_transport_tx_fn_type(stream_session_t *s)
int session_manager_flush_enqueue_events(u8 transport_proto, u32 thread_index)
Flushes queue of sessions that are to be notified of new data enqueued events.
int session_stream_connect_notify(transport_connection_t *tc, u8 is_fail)
static vlib_thread_main_t * vlib_get_thread_main()
vlib_node_registration_t session_queue_process_node
(constructor) VLIB_REGISTER_NODE (session_queue_process_node)
static u32 vlib_num_workers()
static vlib_node_t * vlib_get_node(vlib_main_t *vm, u32 i)
Get vlib node by index.
static int session_enqueue_chain_tail(stream_session_t *s, vlib_buffer_t *b, u32 offset, u8 is_in_order)
Enqueue buffer chain tail.
u8 session_tx_is_dgram(stream_session_t *s)
u32 configured_event_queue_length
vpp fifo event queue configured length
int(* session_open_service_fn)(u32, session_endpoint_t *, u32)
static void session_program_transport_close(stream_session_t *s)
int application_is_builtin_proxy(application_t *app)
u32 local_endpoints_table_memory
Transport table (preallocation) size parameters.
segment_manager_t * app_worker_get_connect_segment_manager(app_worker_t *app)
int consumer_pid
pid of msg consumer
#define CLIB_CACHE_LINE_BYTES
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
int session_open_app(u32 app_wrk_index, session_endpoint_t *rmt, u32 opaque)
static int session_alloc_and_init(segment_manager_t *sm, transport_connection_t *tc, u8 alloc_fifos, stream_session_t **ret_s)
void vlib_start_process(vlib_main_t *vm, uword process_index)
int svm_fifo_peek(svm_fifo_t *f, u32 relative_offset, u32 max_bytes, u8 *copy_here)
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_lookup_add_half_open(transport_connection_t *tc, u64 value)
int stream_session_peek_bytes(transport_connection_t *tc, u8 *buffer, u32 offset, u32 max_bytes)
u8 transport_protocol_is_cl(transport_proto_t tp)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
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.
u8 stream_session_no_space(transport_connection_t *tc, u32 thread_index, u16 data_len)
Check if we have space in rx fifo to push more bytes.
uword session_va_space_size