X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvpp%2Fstats%2Fstats.c;h=5eea25e4464f559a825be1acb7e6322246f3fa12;hb=58492a83722caf1c49977d73abf931418ce1f8f2;hp=9f912109e6e6c6e8ef5483df864e01a5ad08a83c;hpb=586479a73162426a02b2bbc8ab724e0dfb9921e0;p=vpp.git diff --git a/src/vpp/stats/stats.c b/src/vpp/stats/stats.c index 9f912109e6e..5eea25e4464 100644 --- a/src/vpp/stats/stats.c +++ b/src/vpp/stats/stats.c @@ -2348,7 +2348,6 @@ static clib_error_t * stats_socket_accept_ready (clib_file_t * uf) { stats_main_t *sm = &stats_main; - ssvm_private_t *ssvmp = &sm->stat_segment; clib_error_t *err; clib_socket_t client = { 0 }; @@ -2360,7 +2359,7 @@ stats_socket_accept_ready (clib_file_t * uf) } /* Send the fd across and close */ - err = clib_socket_sendmsg (&client, 0, 0, &ssvmp->fd, 1); + err = clib_socket_sendmsg (&client, 0, 0, &sm->memfd, 1); if (err) clib_error_report (err); clib_socket_close (&client); @@ -2451,7 +2450,7 @@ static void vl_api_stats_get_poller_delay_reply_t *rmp; rmp = vl_msg_api_alloc (sizeof (*rmp)); - rmp->_vl_msg_id = ntohs (VL_API_WANT_PER_INTERFACE_SIMPLE_STATS_REPLY); + rmp->_vl_msg_id = ntohs (VL_API_STATS_GET_POLLER_DELAY_REPLY); rmp->context = mp->context; rmp->retval = 0; rmp->delay = clib_host_to_net_u32 (sm->stats_poll_interval_in_seconds); @@ -2474,12 +2473,12 @@ stats_thread_fn (void *arg) pthread_sigmask (SIG_SETMASK, &s, 0); } + clib_mem_set_heap (w->thread_mheap); + if (vec_len (tm->thread_prefix)) vlib_set_thread_name ((char *) format (0, "%v_stats%c", tm->thread_prefix, '\0')); - clib_mem_set_heap (w->thread_mheap); - while (1) { ip46_fib_stats_delay (sm, sm->stats_poll_interval_in_seconds, @@ -3098,9 +3097,10 @@ vl_api_vnet_get_summary_stats_t_handler (vl_api_vnet_get_summary_stats_t * mp) vl_api_vnet_get_summary_stats_reply_t *rmp; vlib_combined_counter_main_t *cm; vlib_counter_t v; + vnet_interface_counter_type_t ct; int i, which; - u64 total_pkts[VLIB_N_RX_TX]; - u64 total_bytes[VLIB_N_RX_TX]; + u64 total_pkts[VNET_N_COMBINED_INTERFACE_COUNTER]; + u64 total_bytes[VNET_N_COMBINED_INTERFACE_COUNTER]; vl_api_registration_t *reg; reg = vl_api_client_index_to_registration (mp->client_index); @@ -3130,10 +3130,17 @@ vl_api_vnet_get_summary_stats_t_handler (vl_api_vnet_get_summary_stats_t * mp) } vnet_interface_counter_unlock (im); - rmp->total_pkts[VLIB_RX] = clib_host_to_net_u64 (total_pkts[VLIB_RX]); - rmp->total_bytes[VLIB_RX] = clib_host_to_net_u64 (total_bytes[VLIB_RX]); - rmp->total_pkts[VLIB_TX] = clib_host_to_net_u64 (total_pkts[VLIB_TX]); - rmp->total_bytes[VLIB_TX] = clib_host_to_net_u64 (total_bytes[VLIB_TX]); + foreach_rx_combined_interface_counter (ct) + { + rmp->total_pkts[ct] = clib_host_to_net_u64 (total_pkts[ct]); + rmp->total_bytes[ct] = clib_host_to_net_u64 (total_bytes[ct]); + } + + foreach_tx_combined_interface_counter (ct) + { + rmp->total_pkts[ct] = clib_host_to_net_u64 (total_pkts[ct]); + rmp->total_bytes[ct] = clib_host_to_net_u64 (total_bytes[ct]); + } rmp->vector_rate = clib_host_to_net_u64 (vlib_last_vector_length_per_node (sm->vlib_main));