- 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, "\n\nConn cleaner thread counters:\n");
-#define _(cnt, desc) out0 = format(out0, " %20lu: %s\n", am->cnt, desc);
- foreach_fa_cleaner_counter;
+ acl_fa_per_worker_data_t *pw = &am->per_worker_data[wk];
+ vlib_cli_output (vm, "Thread #%d:", wk);
+ if (show_session_thread_id == wk
+ && show_session_session_index < pool_len (pw->fa_sessions_pool))
+ {
+ vlib_cli_output (vm, " session index %u:",
+ show_session_session_index);
+ fa_session_t *sess =
+ pw->fa_sessions_pool + show_session_session_index;
+ u64 *m = (u64 *) & sess->info;
+ vlib_cli_output (vm,
+ " info: %016llx %016llx %016llx %016llx %016llx %016llx",
+ m[0], m[1], m[2], m[3], m[4], m[5]);
+ vlib_cli_output (vm, " sw_if_index: %u", sess->sw_if_index);
+ vlib_cli_output (vm, " tcp_flags_seen: %x",
+ sess->tcp_flags_seen.as_u16);
+ vlib_cli_output (vm, " last active time: %lu",
+ sess->last_active_time);
+ vlib_cli_output (vm, " thread index: %u", sess->thread_index);
+ vlib_cli_output (vm, " link enqueue time: %lu",
+ sess->link_enqueue_time);
+ vlib_cli_output (vm, " link next index: %u",
+ sess->link_next_idx);
+ vlib_cli_output (vm, " link prev index: %u",
+ sess->link_prev_idx);
+ vlib_cli_output (vm, " link list id: %u", sess->link_list_id);
+ }
+ vlib_cli_output (vm, " connection add/del stats:", 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;
+ vlib_cli_output (vm,
+ " sw_if_index %d: add %lu - del %lu = %lu",
+ sw_if_index,
+ n_adds,
+ n_dels,
+ n_adds -
+ n_dels);
+ }
+ ));
+
+ vlib_cli_output (vm, " connection timeout type lists:", wk);
+ u8 tt = 0;
+ for (tt = 0; tt < ACL_N_TIMEOUTS; tt++)
+ {
+ u32 head_session_index = pw->fa_conn_list_head[tt];
+ vlib_cli_output (vm, " fa_conn_list_head[%d]: %d", tt,
+ head_session_index);
+ if (~0 != head_session_index)
+ {
+ fa_session_t *sess = pw->fa_sessions_pool + head_session_index;
+ vlib_cli_output (vm, " last active time: %lu",
+ sess->last_active_time);
+ vlib_cli_output (vm, " link enqueue time: %lu",
+ sess->link_enqueue_time);
+ }
+ }
+
+ vlib_cli_output (vm, " Next expiry time: %lu", pw->next_expiry_time);
+ vlib_cli_output (vm, " Requeue until time: %lu",
+ pw->requeue_until_time);
+ vlib_cli_output (vm, " Current time wait interval: %lu",
+ pw->current_time_wait_interval);
+ vlib_cli_output (vm, " Count of deleted sessions: %lu",
+ pw->cnt_deleted_sessions);
+ vlib_cli_output (vm, " Delete already deleted: %lu",
+ pw->cnt_already_deleted_sessions);
+ vlib_cli_output (vm, " Session timers restarted: %lu",
+ pw->cnt_session_timer_restarted);
+ vlib_cli_output (vm, " Swipe until this time: %lu",
+ pw->swipe_end_time);
+ vlib_cli_output (vm, " sw_if_index serviced bitmap: %U",
+ format_bitmap_hex, pw->serviced_sw_if_index_bitmap);
+ vlib_cli_output (vm, " pending clear intfc bitmap : %U",
+ format_bitmap_hex,
+ pw->pending_clear_sw_if_index_bitmap);
+ vlib_cli_output (vm, " clear in progress: %u", pw->clear_in_process);
+ vlib_cli_output (vm, " interrupt is pending: %d",
+ pw->interrupt_is_pending);
+ vlib_cli_output (vm, " interrupt is needed: %d",
+ pw->interrupt_is_needed);
+ vlib_cli_output (vm, " interrupt is unwanted: %d",
+ pw->interrupt_is_unwanted);
+ vlib_cli_output (vm, " interrupt generation: %d",
+ pw->interrupt_generation);
+ }
+ vlib_cli_output (vm, "\n\nConn cleaner thread counters:");
+#define _(cnt, desc) vlib_cli_output(vm, " %20lu: %s", am->cnt, desc);
+ foreach_fa_cleaner_counter;