33 for (thread = 0; thread <
vec_len (session_dbg_main.
wrk); thread++)
38 #define _(sym, disp, type, str) \ 42 vlib_cli_output (vm, "\t %25s : %12lu ", str, \ 43 sdm->counters[SESS_Q_##sym].u64); \ 45 vlib_cli_output (vm, "\t %25s : %12.3f ", str, \ 46 sdm->counters[SESS_Q_##sym].f64); \ 58 .path =
"show session dbg clock_cycles",
59 .short_help =
"show session dbg clock_cycles",
60 .function = show_session_dbg_clock_cycles_fn,
76 for (thread = 0; thread <
vec_len (session_dbg_main.
wrk); thread++)
91 .path =
"clear session dbg clock_cycles",
92 .short_help =
"clear session dbg clock_cycles",
93 .function = clear_session_dbg_clock_cycles_fn,
107 for (thread = 0; thread < num_threads; thread++)
125 session_event_t _e, *e = &_e;
137 for (i = 0; i < sq->
cursize; i++)
143 switch (e->event_type)
152 fformat (stdout,
"[%04d] disconnect session %d\n", i,
162 fformat (stdout,
"[%04d] RPC call %llx with %llx\n",
168 fformat (stdout,
"[%04d] unhandled event type %d\n",
184 switch (e->event_type)
191 if (e->session_index == f->shr->master_session_index)
225 thread_index = f->master_thread_index;
234 for (i = 0; i < sq->
cursize; i++)
242 index = (index + 1) % sq->
maxsize;
252 found = session_node_cmp_event (&elt->evt, f);
255 clib_memcpy_fast (e, &elt->evt, sizeof (*e));
265 found = session_node_cmp_event (&elt->evt, f);
268 clib_memcpy_fast (e, &elt->evt, sizeof (*e));
static u8 session_node_cmp_event(session_event_t *e, svm_fifo_t *f)
void * svm_msg_q_msg_data(svm_msg_q_t *mq, svm_msg_q_msg_t *msg)
Get data for message in queue.
svm_msg_q_t * vpp_event_queue
vpp event message queue for worker
u32 session_index
Index in thread pool where session was allocated.
svm_msg_q_shared_queue_t * shr
pointer to shared queue
static svm_msg_q_t * session_main_get_vpp_event_queue(u32 thread_index)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static f64 vlib_time_now(vlib_main_t *vm)
svm_fifo_t * rx_fifo
Pointers to rx/tx buffers.
static session_t * session_get_if_valid(u64 si, u32 thread_index)
session_dbg_main_t session_dbg_main
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)
#define clib_llist_foreach(LP, name, H, E, body)
Walk list starting at head.
static session_worker_t * session_main_get_worker(u32 thread_index)
clib_llist_index_t new_head
Head of list of elements.
#define clib_error_return(e, args...)
pthread_t thread[MAX_CONNS]
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static session_t * session_get_from_handle(session_handle_t handle)
svm_msg_q_ring_t * svm_msg_q_ring(svm_msg_q_t *mq, u32 ring_index)
Get message queue ring.
svm_msg_q_queue_t q
queue for exchanging messages
u8 session_node_lookup_fifo_event(svm_fifo_t *f, session_event_t *e)
sll srl srl sll sra u16x4 i
#define clib_warning(format, args...)
#define VLIB_CLI_COMMAND(x,...)
static vlib_main_t * vlib_get_first_main(void)
u32 ring_index
ring index, could be u8
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
#define foreach_session_events
static_always_inline void * clib_memcpy_fast(void *restrict dst, const void *restrict src, size_t n)
void dump_thread_0_event_queue(void)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
clib_llist_index_t old_head
Head of list of pending events.
void session_debug_init(void)
u32 elsize
size of an element
static vlib_thread_main_t * vlib_get_thread_main()
#define CLIB_CACHE_LINE_BYTES
struct _svm_fifo svm_fifo_t