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++)
126 session_event_t _e, *e = &_e;
136 for (i = 0; i < mq->
q->cursize; i++)
142 switch (e->event_type)
151 fformat (stdout,
"[%04d] disconnect session %d\n", i,
161 fformat (stdout,
"[%04d] RPC call %llx with %llx\n",
167 fformat (stdout,
"[%04d] unhandled event type %d\n",
174 if (index == mq->
q->maxsize)
183 switch (e->event_type)
190 if (e->session_index == f->master_session_index)
223 thread_index = f->master_thread_index;
231 for (i = 0; i < mq->
q->cursize; i++)
239 index = (index + 1) % mq->
q->maxsize;
249 found = session_node_cmp_event (&elt->evt, f);
252 clib_memcpy_fast (e, &elt->evt, sizeof (*e));
262 found = session_node_cmp_event (&elt->evt, f);
265 clib_memcpy_fast (e, &elt->evt, sizeof (*e));
vlib_main_t vlib_global_main
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.
#define clib_memcpy_fast(a, b, c)
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.
session_worker_t * wrk
Worker contexts.
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)
vlib_main_t ** vlib_mains
#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.
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...)
svm_queue_t * q
queue for exchanging messages
#define VLIB_CLI_COMMAND(x,...)
u32 ring_index
ring index, could be u8
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
#define foreach_session_events
void dump_thread_0_event_queue(void)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
void session_debug_init(void)
u32 elsize
size of an element
static vlib_thread_main_t * vlib_get_thread_main()
static session_main_t * vnet_get_session_main()
#define CLIB_CACHE_LINE_BYTES
struct _svm_fifo svm_fifo_t