- u8 * out0 = format(0, "");
- u16 wk;
- u32 show_bihash_verbose = 0;
- u32 show_session_thread_id = ~0;
- u32 show_session_session_index = ~0;
- unformat (input, "thread %u index %u", &show_session_thread_id, &show_session_session_index);
- unformat (input, "verbose %u", &show_bihash_verbose);
- {
- u64 n_adds = am->fa_session_total_adds;
- u64 n_dels = am->fa_session_total_dels;
- out0 = format(out0, "Sessions total: add %lu - del %lu = %lu\n", n_adds, n_dels, n_adds - n_dels);
- }
- out0 = format(out0, "\n\nPer-thread data:\n");
- for (wk = 0; wk < vec_len (am->per_worker_data); wk++) {
- acl_fa_per_worker_data_t *pw = &am->per_worker_data[wk];
- out0 = format(out0, "Thread #%d:\n", wk);
- if (show_session_thread_id == wk && show_session_session_index < pool_len(pw->fa_sessions_pool)) {
- out0 = format(out0, " session index %u:\n", show_session_session_index);
- fa_session_t *sess = pw->fa_sessions_pool + show_session_session_index;
- u64 *m = (u64 *)&sess->info;
- out0 = format(out0, " info: %016llx %016llx %016llx %016llx %016llx %016llx\n", m[0], m[1], m[2], m[3], m[4], m[5]);
- out0 = format(out0, " sw_if_index: %u\n", sess->sw_if_index);
- out0 = format(out0, " tcp_flags_seen: %x\n", sess->tcp_flags_seen.as_u16);
- out0 = format(out0, " last active time: %lu\n", sess->last_active_time);
- out0 = format(out0, " thread index: %u\n", sess->thread_index);
- out0 = format(out0, " link enqueue time: %lu\n", sess->link_enqueue_time);
- out0 = format(out0, " link next index: %u\n", sess->link_next_idx);
- out0 = format(out0, " link prev index: %u\n", sess->link_prev_idx);
- out0 = format(out0, " link list id: %u\n", sess->link_list_id);
- }
- out0 = format(out0, " connection add/del stats:\n", wk);
- pool_foreach (swif, im->sw_interfaces,
- ({
- u32 sw_if_index = swif->sw_if_index;
- u64 n_adds = sw_if_index < vec_len(pw->fa_session_adds_by_sw_if_index) ? pw->fa_session_adds_by_sw_if_index[sw_if_index] : 0;
- u64 n_dels = sw_if_index < vec_len(pw->fa_session_dels_by_sw_if_index) ? pw->fa_session_dels_by_sw_if_index[sw_if_index] : 0;
- out0 = format(out0, " sw_if_index %d: add %lu - del %lu = %lu\n", sw_if_index, n_adds, n_dels, n_adds - n_dels);
- }));
-
- out0 = format(out0, " connection timeout type lists:\n", wk);
- u8 tt = 0;
- for(tt = 0; tt < ACL_N_TIMEOUTS; tt++) {
- u32 head_session_index = pw->fa_conn_list_head[tt];
- out0 = format(out0, " fa_conn_list_head[%d]: %d\n", tt, head_session_index);
- if (~0 != head_session_index) {
- fa_session_t *sess = pw->fa_sessions_pool + head_session_index;
- out0 = format(out0, " last active time: %lu\n", sess->last_active_time);
- out0 = format(out0, " link enqueue time: %lu\n", sess->link_enqueue_time);
- }
- }
-
- out0 = format(out0, " Next expiry time: %lu\n", pw->next_expiry_time);
- out0 = format(out0, " Requeue until time: %lu\n", pw->requeue_until_time);
- out0 = format(out0, " Current time wait interval: %lu\n", pw->current_time_wait_interval);
- out0 = format(out0, " Count of deleted sessions: %lu\n", pw->cnt_deleted_sessions);
- out0 = format(out0, " Delete already deleted: %lu\n", pw->cnt_already_deleted_sessions);
- out0 = format(out0, " Session timers restarted: %lu\n", pw->cnt_session_timer_restarted);
- out0 = format(out0, " Swipe until this time: %lu\n", pw->swipe_end_time);
- out0 = format(out0, " sw_if_index serviced bitmap: %U\n", format_bitmap_hex, pw->serviced_sw_if_index_bitmap);
- out0 = format(out0, " pending clear intfc bitmap : %U\n", format_bitmap_hex, pw->pending_clear_sw_if_index_bitmap);
- out0 = format(out0, " clear in progress: %u\n", pw->clear_in_process);
- out0 = format(out0, " interrupt is pending: %d\n", pw->interrupt_is_pending);
- out0 = format(out0, " interrupt is needed: %d\n", pw->interrupt_is_needed);
- out0 = format(out0, " interrupt is unwanted: %d\n", pw->interrupt_is_unwanted);
- out0 = format(out0, " interrupt generation: %d\n", pw->interrupt_generation);
- }
- out0 = format(out0, "\n\nConn cleaner thread counters:\n");
-#define _(cnt, desc) out0 = format(out0, " %20lu: %s\n", am->cnt, desc);
- foreach_fa_cleaner_counter;
-#undef _
- vec_terminate_c_string(out0);
- vlib_cli_output(vm, "\n\n%s\n\n", out0);
- vlib_cli_output(vm, "Interrupt generation: %d\n", am->fa_interrupt_generation);
- vlib_cli_output(vm, "Sessions per interval: min %lu max %lu increment: %f ms current: %f ms",
- am->fa_min_deleted_sessions_per_interval, am->fa_max_deleted_sessions_per_interval,
- am->fa_cleaner_wait_time_increment * 1000.0, ((f64)am->fa_current_cleaner_timer_wait_interval) * 1000.0/(f64)vm->clib_time.clocks_per_second);
-
- vec_free(out0);
- show_fa_sessions_hash(vm, show_bihash_verbose);
- }
- else if (unformat (input, "interface"))
- {
- u32 sw_if_index = ~0;
- u32 swi;
- u8 * out0 = format(0, "");
- unformat (input, "sw_if_index %u", &sw_if_index);
- for(swi = 0; (swi < vec_len(am->input_acl_vec_by_sw_if_index)) ||
- (swi < vec_len(am->output_acl_vec_by_sw_if_index)); swi++) {
- out0 = format(out0, "sw_if_index %d:\n", swi);
-
- if ((swi < vec_len(am->input_acl_vec_by_sw_if_index)) &&
- (vec_len(am->input_acl_vec_by_sw_if_index[swi]) > 0)) {
- out0 = format(out0, " input acl(s): ");
- vec_foreach(pj, am->input_acl_vec_by_sw_if_index[swi]) {
- out0 = format(out0, "%d ", *pj);
- }
- out0 = format(out0, "\n");
- }
-
- if ((swi < vec_len(am->output_acl_vec_by_sw_if_index)) &&
- (vec_len(am->output_acl_vec_by_sw_if_index[swi]) > 0)) {
- out0 = format(out0, " output acl(s): ");
- vec_foreach(pj, am->output_acl_vec_by_sw_if_index[swi]) {
- out0 = format(out0, "%d ", *pj);
- }
- out0 = format(out0, "\n");
- }