50 evt->rpc_args.fp =
data;
51 evt->rpc_args.arg = args;
59 evt->session_index = *(
u32 *) data;
73 evt->event_type = evt_type;
83 f->master_thread_index, evt_type);
117 void (*fnp) (
void *) = fp;
142 elt->
evt.session_index = tc->s_index;
163 elt->
evt.event_type = evt;
229 || s->
thread_index != tc->thread_index || tc->s_index != si)
301 u32 to_drop = n_bytes_to_drop;
303 while (to_drop && (next->
flags & VLIB_BUFFER_NEXT_PRESENT))
337 if (is_in_order && offset)
365 return (rv > 0) ? (written + rv) : written;
390 while ((chain_bi = (chain_b->
flags & VLIB_BUFFER_NEXT_PRESENT)
416 u8 queue_event,
u8 is_in_order)
419 int enqueued = 0, rv, in_order_off;
471 int enqueued = 0, rv, in_order_off;
536 for (i = 0; i < f->n_subscribers; i++)
673 for (i = 0; i <
vec_len (indices); i++)
706 u32 opaque = 0, new_ti, new_si;
729 opaque = tc->s_index;
768 SESSION_STATE_READY);
775 SESSION_STATE_OPENED);
778 typedef struct _session_switch_pool_args
782 u32 new_thread_index;
783 u32 new_session_index;
797 s =
session_get (args->session_index, args->thread_index);
798 s->
tx_fifo->master_session_index = args->new_session_index;
799 s->
tx_fifo->master_thread_index = args->new_thread_index;
808 args->new_thread_index);
846 rpc_args->session_index = tc->s_index;
847 rpc_args->thread_index = old_thread_index;
853 *new_session = new_s;
897 case SESSION_STATE_CREATED:
904 case SESSION_STATE_ACCEPTING:
905 case SESSION_STATE_TRANSPORT_CLOSING:
906 case SESSION_STATE_CLOSING:
907 case SESSION_STATE_TRANSPORT_CLOSED:
918 case SESSION_STATE_APP_CLOSED:
930 case SESSION_STATE_TRANSPORT_DELETED:
932 case SESSION_STATE_CLOSED:
1021 u32 thread_index,
u8 notify)
1059 SESSION_DBG (
"Transport failed to open connection.");
1060 return VNET_API_ERROR_SESSION_CONNECT;
1093 SESSION_DBG (
"Transport failed to open connection.");
1094 return VNET_API_ERROR_SESSION_CONNECT;
1106 handle = (((
u64) app_wrk_index) << 32) | (
u64) tc->c_index;
1112 tc->s_index = opaque;
1124 sep->app_wrk_index = app_wrk_index;
1125 sep->opaque = opaque;
1173 u32 tc_index, s_index;
1181 if (tc_index == (
u32) ~ 0)
1208 return VNET_API_ERROR_ADDRESS_NOT_IN_USE;
1271 else if (s->
session_state >= SESSION_STATE_TRANSPORT_DELETED)
1298 else if (s->
session_state >= SESSION_STATE_TRANSPORT_DELETED)
1340 u32 evt_q_length = 2048, evt_size =
sizeof (session_event_t);
1343 uword eqs_size = 64 << 20;
1344 pid_t vpp_pid = getpid ();
1359 eqs->
name =
format (0,
"%s%c",
"evt-qs-segment", 0);
1378 {evt_q_length, evt_size, 0}
1380 {evt_q_length >> 1, 256, 0}
1427 session_tx_fifo_dequeue_and_snd
1444 u32 next_index = ~0;
1452 if (output_node != ~0)
1511 u32 num_threads, preallocated_sessions_per_worker;
1517 if (num_threads < 1)
1523 for (i = 0; i < num_threads; i++)
1533 if (num_threads > 1)
1548 if (num_threads == 1)
1555 preallocated_sessions_per_worker =
1557 (
f64) (num_threads - 1));
1559 for (j = 1; j < num_threads; j++)
1562 preallocated_sessions_per_worker);
1581 u8 state = is_en ? VLIB_NODE_STATE_POLLING : VLIB_NODE_STATE_DISABLED;
1587 if (have_workers && ii == 0)
1638 #if (HIGH_SEGMENT_BASEVA > (4ULL << 30)) 1675 if (
unformat (input,
"event-queue-length %d", &nitems))
1680 clib_warning (
"event queue length %d too small, ignored", nitems);
1682 else if (
unformat (input,
"preallocated-sessions %d",
1685 else if (
unformat (input,
"v4-session-table-buckets %d",
1688 else if (
unformat (input,
"v4-halfopen-table-buckets %d",
1691 else if (
unformat (input,
"v6-session-table-buckets %d",
1694 else if (
unformat (input,
"v6-halfopen-table-buckets %d",
1697 else if (
unformat (input,
"v4-session-table-memory %U",
1700 if (tmp >= 0x100000000)
1705 else if (
unformat (input,
"v4-halfopen-table-memory %U",
1708 if (tmp >= 0x100000000)
1713 else if (
unformat (input,
"v6-session-table-memory %U",
1716 if (tmp >= 0x100000000)
1721 else if (
unformat (input,
"v6-halfopen-table-memory %U",
1724 if (tmp >= 0x100000000)
1729 else if (
unformat (input,
"local-endpoints-table-memory %U",
1732 if (tmp >= 0x100000000)
1737 else if (
unformat (input,
"local-endpoints-table-buckets %d",
1740 else if (
unformat (input,
"evt_qs_memfd_seg"))
1745 else if (
unformat (input,
"enable"))
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
#define session_endpoint_to_transport_cfg(_sep)
u32 preallocated_sessions
Preallocate session config parameter.
int app_worker_lock_and_send_event(app_worker_t *app, session_t *s, u8 evt_type)
Send event to application.
void transport_close(transport_proto_t tp, u32 conn_index, u8 thread_index)
static session_open_service_fn session_open_srv_fns[TRANSPORT_N_SERVICES]
u32 connection_index
Index of the transport connection associated to the session.
uword evt_qs_segment_size
void session_flush_frames_main_thread(vlib_main_t *vm)
int app_worker_init_accepted(session_t *s)
void session_transport_reset(session_t *s)
Force transport close.
int session_lookup_del_connection(transport_connection_t *tc)
Delete transport connection from session table.
int app_worker_reset_notify(app_worker_t *app_wrk, session_t *s)
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)
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)
session_type_t session_type
Type built from transport and network protocol types.
#define SESSION_Q_PROCESS_FLUSH_FRAMES
svm_msg_q_t * vpp_event_queue
vpp event message queue for worker
void transport_get_listener_endpoint(transport_proto_t tp, u32 conn_index, transport_endpoint_t *tep, u8 is_lcl)
static u32 svm_fifo_max_enqueue_prod(svm_fifo_t *f)
Maximum number of bytes that can be enqueued into fifo.
static void clib_rwlock_writer_lock(clib_rwlock_t *p)
session_main_t session_main
int session_tx_fifo_peek_bytes(transport_connection_t *tc, u8 *buffer, u32 offset, u32 max_bytes)
#define VLIB_MAIN_LOOP_ENTER_FUNCTION(x)
u32 session_index
Index in thread pool where session was allocated.
int session_stop_listen(session_t *s)
Ask transport to stop listening on local transport endpoint.
transport_connection_t * listen_session_get_transport(session_t *s)
static svm_msg_q_t * session_main_get_vpp_event_queue(u32 thread_index)
u32 configured_v4_halfopen_table_buckets
u8 session_enable_asap
Enable session manager at startup.
int session_ho_stream_connect_notify(transport_connection_t *tc, u8 is_fail)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
void session_transport_delete_notify(transport_connection_t *tc)
Notification from transport that connection is being deleted.
transport_connection_t * session_get_transport(session_t *s)
static f64 vlib_time_now(vlib_main_t *vm)
svm_fifo_t * rx_fifo
Pointers to rx/tx buffers.
session_worker_t * wrk
Worker contexts.
static session_t * session_get_if_valid(u64 si, u32 thread_index)
void session_add_self_custom_tx_evt(transport_connection_t *tc, u8 has_prio)
#define pool_get_aligned_will_expand(P, YESNO, A)
See if pool_get will expand the pool or not.
int session_enqueue_dgram_connection(session_t *s, session_dgram_hdr_t *hdr, vlib_buffer_t *b, u8 proto, u8 queue_event)
u16 current_length
Nbytes between current data and the end of this buffer.
static int session_enqueue_notify_inline(session_t *s)
Notify session peer that new data has been enqueued.
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.
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
static transport_proto_t session_get_transport_proto(session_t *s)
void session_send_rpc_evt_to_thread(u32 thread_index, void *fp, void *rpc_args)
int svm_fifo_peek(svm_fifo_t *f, u32 offset, u32 len, u8 *dst)
Peek data from fifo.
void session_transport_reset_notify(transport_connection_t *tc)
Notify application that connection has been reset.
int session_open_vc(u32 app_wrk_index, session_endpoint_t *rmt, u32 opaque)
void svm_fifo_dequeue_drop_all(svm_fifo_t *f)
Dequeue and drop all bytes from fifo.
ssvm_shared_header_t * sh
u32 transport_start_listen(transport_proto_t tp, u32 session_index, transport_endpoint_t *tep)
static session_t * session_get(u32 si, u32 thread_index)
session_evt_elt_t * event_elts
Pool of session event list elements.
#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)
static session_t * session_clone_safe(u32 session_index, u32 thread_index)
u32 local_endpoints_table_memory
Transport table (preallocation) size parameters.
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
static uword vlib_node_add_next(vlib_main_t *vm, uword node, uword next_node)
app_worker_t * application_get_worker(application_t *app, u32 wrk_map_index)
session_fifo_rx_fn session_tx_fifo_peek_and_snd
session_t * sessions
Worker session pool.
#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]
#define vlib_worker_thread_barrier_sync(X)
static session_handle_t session_handle(session_t *s)
struct _svm_fifo svm_fifo_t
void session_get_endpoint(session_t *s, transport_endpoint_t *tep, u8 is_lcl)
void session_transport_closing_notify(transport_connection_t *tc)
Notification from transport that connection is being closed.
u64 segment_manager_make_segment_handle(u32 segment_manager_index, u32 segment_index)
int session_open_cl(u32 app_wrk_index, session_endpoint_t *rmt, u32 opaque)
#define clib_llist_make_head(LP, name)
Initialize llist head.
static session_worker_t * session_main_get_worker(u32 thread_index)
void session_free_w_fifos(session_t *s)
#define session_endpoint_to_transport(_sep)
void app_namespaces_init(void)
vlib_main_t * vm
Convenience pointer to this worker's vlib_main.
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.
u8 transport_half_open_has_fifos(transport_proto_t tp)
int session_send_ctrl_evt_to_thread(session_t *s, session_evt_type_t evt_type)
#define VLIB_INIT_FUNCTION(x)
static void * svm_push_data_heap(svm_region_t *rp)
void segment_manager_dealloc_fifos(svm_fifo_t *rx_fifo, svm_fifo_t *tx_fifo)
clib_llist_index_t new_head
Head of list of elements.
u32 * session_type_to_next
Per session type output nodes.
static int session_stream_connect_notify_inline(transport_connection_t *tc, u8 is_fail, session_state_t opened_state)
static int session_enqueue_chain_tail(session_t *s, vlib_buffer_t *b, u32 offset, u8 is_in_order)
Enqueue buffer chain tail.
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.
uword session_baseva
Session ssvm segment configs.
vhost_vring_state_t state
int session_send_io_evt_to_thread(svm_fifo_t *f, session_evt_type_t evt_type)
int ssvm_master_init(ssvm_private_t *ssvm, ssvm_segment_type_t type)
u8 session_is_valid(u32 si, u8 thread_index)
static void ssvm_pop_heap(void *oldheap)
void transport_reset(transport_proto_t tp, u32 conn_index, u8 thread_index)
#define HALF_OPEN_LOOKUP_INVALID_VALUE
#define SESSION_INVALID_HANDLE
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 _transport_proto_vft transport_proto_vft_t
int session_dequeue_notify(session_t *s)
struct _session_endpoint_cfg session_endpoint_cfg_t
u32 configured_v6_halfopen_table_memory
u32 configured_v6_session_table_buckets
static session_type_t session_type_from_proto_and_ip(transport_proto_t proto, u8 is_ip4)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static void clib_rwlock_init(clib_rwlock_t *p)
#define CLIB_US_TIME_FREQ
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)
uword session_va_space_size
void session_send_rpc_evt_to_thread_force(u32 thread_index, void *fp, void *rpc_args)
u32 configured_v4_session_table_buckets
Session table size parameters.
void transport_get_endpoint(transport_proto_t tp, u32 conn_index, u32 thread_index, transport_endpoint_t *tep, u8 is_lcl)
int app_worker_accept_notify(app_worker_t *app_wrk, session_t *s)
u32 app_index
Index of application that owns the listener.
u32 configured_v6_halfopen_table_buckets
u32 configured_event_queue_length
vpp fifo event queue configured length
u8 is_enabled
Session manager is enabled.
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 APP_INVALID_INDEX
int svm_fifo_enqueue(svm_fifo_t *f, u32 len, const u8 *src)
Enqueue data to fifo.
enum transport_service_type_ transport_service_type_t
#define VLIB_CONFIG_FUNCTION(x, n,...)
int session_lookup_del_session(session_t *s)
u32 wrk_index
Worker index in global worker pool.
clib_error_t * session_manager_main_init(vlib_main_t *vm)
app_worker_t * app_worker_get_if_valid(u32 wrk_index)
static u32 svm_fifo_max_dequeue_prod(svm_fifo_t *f)
Fifo max bytes to dequeue optimized for producer.
session_fifo_rx_fn ** session_tx_fns
Per transport rx function that can either dequeue or peek.
u64 session_segment_handle(session_t *s)
#define foreach_vlib_main(body)
static session_evt_elt_t * session_evt_alloc_old(session_worker_t *wrk)
void transport_cleanup(transport_proto_t tp, u32 conn_index, u8 thread_index)
clib_error_t * vnet_session_enable_disable(vlib_main_t *vm, u8 is_en)
u32 transport_stop_listen(transport_proto_t tp, u32 conn_index)
struct _session_switch_pool_args session_switch_pool_args_t
API main structure, used by both vpp and binary API clients.
clib_rwlock_t peekers_rw_locks
Peekers rw lock.
#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)
static u8 svm_fifo_set_event(svm_fifo_t *f)
Set fifo event flag.
u32 n_rings
number of msg rings
void transport_init(void)
int app_worker_transport_closed_notify(app_worker_t *app_wrk, session_t *s)
session_fifo_rx_fn session_tx_fifo_dequeue_and_snd
ssvm_private_t evt_qs_segment
Event queues memfd segment initialized only if so configured.
static u8 svm_fifo_needs_deq_ntf(svm_fifo_t *f, u32 n_last_deq)
Check if fifo needs dequeue notification.
session_handle_t listener_handle
Parent listener session index if the result of an accept.
static_always_inline uword vlib_get_thread_index(void)
int transport_connect(transport_proto_t tp, transport_endpoint_cfg_t *tep)
static void svm_msg_q_unlock(svm_msg_q_t *mq)
Unlock message queue.
static transport_connection_t * transport_get_connection(transport_proto_t tp, u32 conn_index, u8 thread_index)
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.
static void session_cleanup_notify(session_t *s, session_cleanup_ntf_t ntf)
void session_free(session_t *s)
int app_worker_cleanup_notify(app_worker_t *app_wrk, session_t *s, session_cleanup_ntf_t ntf)
#define clib_warning(format, args...)
static int session_send_evt_to_thread(void *data, void *args, u32 thread_index, session_evt_type_t evt_type)
int session_dgram_connect_notify(transport_connection_t *tc, u32 old_thread_index, session_t **new_session)
Move dgram session to the right thread.
Don't register connection in lookup Does not apply to local apps and transports using the network lay...
struct _transport_connection transport_connection_t
#define HIGH_SEGMENT_BASEVA
int app_worker_init_connected(app_worker_t *app_wrk, session_t *s)
static session_evt_elt_t * session_evt_alloc_new(session_worker_t *wrk)
void transport_enable_disable(vlib_main_t *vm, u8 is_en)
static u8 vlib_thread_is_main_w_barrier(void)
#define pool_init_fixed(pool, max_elts)
initialize a fixed-size, preallocated pool
application_t * application_get(u32 app_index)
static u32 session_thread_from_handle(session_handle_t handle)
#define SESSION_Q_PROCESS_STOP
int session_listen(session_t *ls, session_endpoint_cfg_t *sep)
Ask transport to listen on session endpoint.
static u32 session_index_from_handle(session_handle_t handle)
#define uword_to_pointer(u, type)
void session_vpp_event_queues_allocate(session_main_t *smm)
Allocate event queues in the shared-memory segment.
static session_handle_t session_make_handle(u32 session_index, u32 thread_index)
static int session_notify_subscribers(u32 app_index, session_t *s, svm_fifo_t *f, session_evt_type_t evt_type)
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.
int session_main_flush_all_enqueue_events(u8 transport_proto)
void segment_manager_main_init(segment_manager_main_init_args_t *a)
static void clib_mem_free(void *p)
enum _transport_proto transport_proto_t
static void svm_fifo_clear_deq_ntf(svm_fifo_t *f)
Clear the want notification flag and set has notification.
int svm_fifo_enqueue_with_offset(svm_fifo_t *f, u32 offset, u32 len, u8 *src)
Enqueue a future segment.
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.
clib_time_type_t last_vlib_time
vlib_time_now last time around the track
u32 configured_v4_halfopen_table_memory
static session_t * session_alloc_for_connection(transport_connection_t *tc)
int app_worker_migrate_notify(app_worker_t *app_wrk, session_t *s, session_handle_t new_sh)
u32 configured_v4_session_table_memory
int session_stream_accept_notify(transport_connection_t *tc)
static void * clib_mem_alloc(uword size)
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...
static uword pointer_to_uword(const void *p)
svm_msg_q_ring_cfg_t * ring_cfgs
array of ring cfgs
static vlib_main_t * vlib_get_main(void)
int() session_fifo_rx_fn(session_worker_t *wrk, vlib_node_runtime_t *node, session_evt_elt_t *e, int *n_tx_packets)
u8 thread_index
Index of the thread that allocated the session.
session_t * session_alloc(u32 thread_index)
void session_transport_cleanup(session_t *s)
Cleanup transport and session state.
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.
template key/value backing page structure
static void session_switch_pool(void *cb_args)
Notify old thread of the session pool switch.
static transport_connection_t * transport_get_half_open(transport_proto_t tp, u32 conn_index)
u32 local_endpoints_table_buckets
app_worker_t * app_worker_get(u32 wrk_index)
u32 q_nitems
msg queue size (not rings)
void session_lookup_init(void)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
session_fifo_rx_fn session_tx_fifo_dequeue_internal
clib_llist_index_t old_head
Head of list of pending events.
u32 next_buffer
Next buffer for this linked-list of buffers.
volatile u8 session_state
State in session layer state machine.
int session_enqueue_notify(session_t *s)
void session_transport_closed_notify(transport_connection_t *tc)
Notification from transport that it is closed.
u32 * session_to_enqueue[TRANSPORT_N_PROTO]
Per-proto vector of sessions to enqueue.
void session_close(session_t *s)
Initialize session closing procedure.
VLIB buffer representation.
void session_reset(session_t *s)
Force a close without waiting for data to be flushed.
ssvm_private_t * session_main_get_evt_q_segment(void)
int session_send_io_evt_to_thread_custom(void *data, u32 thread_index, session_evt_type_t evt_type)
static session_evt_elt_t * session_evt_alloc_ctrl(session_worker_t *wrk)
u32 app_index
Index of owning app.
static u8 svm_fifo_n_subscribers(svm_fifo_t *f)
int session_lookup_add_connection(transport_connection_t *tc, u64 value)
Add transport connection to a session table.
void vlib_worker_thread_barrier_release(vlib_main_t *vm)
u32 configured_v6_session_table_memory
clib_us_time_t last_vlib_us_time
vlib_time_now rounded to us precision and as u64
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.
int(* session_open_service_fn)(u32, session_endpoint_t *, u32)
u32 app_wrk_index
Index of the app worker that owns the session.
u32 session_tx_fifo_dequeue_drop(transport_connection_t *tc, u32 max_bytes)
static void session_delete(session_t *s)
Cleans up session and lookup table.
void session_transport_close(session_t *s)
Notify transport the session can be disconnected.
static clib_error_t * session_main_init(vlib_main_t *vm)
clib_llist_index_t ctrl_head
Head of control events list.
int app_worker_close_notify(app_worker_t *app_wrk, session_t *s)
struct _session_endpoint session_endpoint_t
int session_stream_accept(transport_connection_t *tc, u32 listener_index, u32 thread_index, u8 notify)
Accept a stream session.
int consumer_pid
pid of msg consumer
#define CLIB_CACHE_LINE_BYTES
static transport_connection_t * transport_get_listener(transport_proto_t tp, u32 conn_index)
u32 total_length_not_including_first_buffer
Only valid for first buffer in chain.
int svm_fifo_dequeue_drop(svm_fifo_t *f, u32 len)
Dequeue and drop bytes from fifo.
static int svm_msg_q_lock(svm_msg_q_t *mq)
Lock, or block trying, the message queue.
static void session_enqueue_notify_rpc(void *arg)
int session_open_app(u32 app_wrk_index, session_endpoint_t *rmt, u32 opaque)
void vlib_start_process(vlib_main_t *vm, uword process_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_lookup_add_half_open(transport_connection_t *tc, u64 value)
u8 transport_protocol_is_cl(transport_proto_t tp)
static u8 svm_msg_q_is_full(svm_msg_q_t *mq)
Check if message queue is full.
int app_worker_connect_notify(app_worker_t *app_wrk, session_t *s, u32 opaque)
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.
#define SESSION_EVT(_evt, _args...)
static void session_program_transport_ctrl_evt(session_t *s, session_evt_type_t evt)
static session_t * listen_session_get(u32 ls_index)
vl_api_fib_path_nh_proto_t proto