32 #define f64_print(a,b) 43 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 48 #define foreach_stats_msg \ 49 _(WANT_STATS, want_stats) \ 50 _(VNET_INTERFACE_SIMPLE_COUNTERS, vnet_interface_simple_counters) \ 51 _(WANT_INTERFACE_SIMPLE_STATS, want_interface_simple_stats) \ 52 _(VNET_INTERFACE_COMBINED_COUNTERS, vnet_interface_combined_counters) \ 53 _(WANT_INTERFACE_COMBINED_STATS, want_interface_combined_stats) \ 54 _(WANT_PER_INTERFACE_COMBINED_STATS, want_per_interface_combined_stats) \ 55 _(WANT_PER_INTERFACE_SIMPLE_STATS, want_per_interface_simple_stats) \ 56 _(VNET_IP4_FIB_COUNTERS, vnet_ip4_fib_counters) \ 57 _(WANT_IP4_FIB_STATS, want_ip4_fib_stats) \ 58 _(VNET_IP6_FIB_COUNTERS, vnet_ip6_fib_counters) \ 59 _(WANT_IP6_FIB_STATS, want_ip6_fib_stats) \ 60 _(WANT_IP4_MFIB_STATS, want_ip4_mfib_stats) \ 61 _(WANT_IP6_MFIB_STATS, want_ip6_mfib_stats) \ 62 _(VNET_IP4_NBR_COUNTERS, vnet_ip4_nbr_counters) \ 63 _(WANT_IP4_NBR_STATS, want_ip4_nbr_stats) \ 64 _(VNET_IP6_NBR_COUNTERS, vnet_ip6_nbr_counters) \ 65 _(WANT_IP6_NBR_STATS, want_ip6_nbr_stats) \ 66 _(VNET_GET_SUMMARY_STATS, vnet_get_summary_stats) \ 67 _(STATS_GET_POLLER_DELAY, stats_get_poller_delay) \ 68 _(WANT_UDP_ENCAP_STATS, want_udp_encap_stats) 70 #define vl_msg_name_crc_list 71 #include <vpp/stats/stats.api.h> 72 #undef vl_msg_name_crc_list 78 vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 79 foreach_vl_msg_name_crc_stats;
84 #define SIMPLE_COUNTER_BATCH_SIZE 126 85 #define COMBINED_COUNTER_BATCH_SIZE 63 86 #define IP4_FIB_COUNTER_BATCH_SIZE 48 87 #define IP6_FIB_COUNTER_BATCH_SIZE 30 88 #define IP4_MFIB_COUNTER_BATCH_SIZE 24 89 #define IP6_MFIB_COUNTER_BATCH_SIZE 15 90 #define UDP_ENCAP_COUNTER_BATCH_SIZE (1024 / sizeof(vl_api_udp_encap_counter_t)) 93 #define STATS_RELEASE_DELAY_NS (1000 * 1000 * 5) 106 count = ntohl (mp->
count);
122 counter_name =
"bogus";
125 for (i = 0; i <
count; i++)
128 packets = clib_net_to_host_u64 (packets);
130 bytes = clib_net_to_host_u64 (bytes);
132 s =
format (s,
"%U.%s.packets %lld\n",
134 sm->
vnet_main, sw_if_index, counter_name, packets);
135 s =
format (s,
"%U.%s.bytes %lld\n",
137 sm->
vnet_main, sw_if_index, counter_name, bytes);
151 count = ntohl (mp->
count);
160 counter_name =
"drop";
163 counter_name =
"punt";
166 counter_name =
"ip4";
169 counter_name =
"ip6";
172 counter_name =
"rx-no-buff";
175 counter_name =
"rx-miss";
178 counter_name =
"rx-error (fifo-full)";
181 counter_name =
"tx-error (fifo-full)";
184 counter_name =
"bogus";
190 v = clib_net_to_host_u64 (v);
193 sm->
vnet_main, sw_if_index, counter_name, v);
219 while (__sync_lock_test_and_set (&l->
lock, 1))
299 registration->
item = item;
383 u32 reg_index, item, reg;
391 clear_one_client(reg_index, reg, item, client_index);
443 vec_add1 (clients, *client);}
456 #define stats_reg(n) vec_free(registrations[IDX_##n]); 457 #include <vpp/stats/stats.reg> 477 #define stats_reg(n) \ 478 vec_reset_length(registrations[IDX_##n]); 479 #include <vpp/stats/stats.reg> 486 return registrations;
498 #define stats_reg(n) \ 499 vec_add1(registrations[IDX_##n], ~0); 500 #include <vpp/stats/stats.reg> 502 return registrations;
514 u32 items_this_message = 0;
527 for (i = 0; i < n_counts; i++)
535 (
sizeof (*mp) + items_this_message *
sizeof (v));
536 mp->_vl_msg_id = ntohs (VL_API_VNET_INTERFACE_SIMPLE_COUNTERS);
546 if (mp->
count == items_this_message)
548 mp->
count = htonl (items_this_message);
561 u32 item,
int enable_disable)
569 if (enable_disable == 0)
605 vl_api_want_interface_combined_stats_reply_t *rmp;
629 rmp->_vl_msg_id = ntohs (VL_API_WANT_INTERFACE_COMBINED_STATS_REPLY);
631 rmp->retval = retval;
653 for (i = 0; i <
vec_len (clients); i++)
671 fformat (stdout,
"%U\n", format_vnet_combined_counters, mp);
693 u32 items_this_message = 0;
702 for (i = 0; i < n_counts; i++)
710 (
sizeof (*mp) + items_this_message *
sizeof (v));
711 mp->_vl_msg_id = ntohs (VL_API_VNET_INTERFACE_COMBINED_COUNTERS);
719 = clib_host_to_net_u64 (v.
packets);
723 if (mp->
count == items_this_message)
725 mp->
count = htonl (items_this_message);
747 vl_api_want_per_interface_combined_stats_reply_t *rmp;
752 u32 i, swif, num = 0;
754 num = ntohl (mp->
num);
759 for (i = 0; i < num; i++)
761 swif = ntohl (mp->
sw_ifs[i]);
770 retval = VNET_API_ERROR_INVALID_SW_IF_INDEX;
776 for (i = 0; i < num; i++)
778 swif = ntohl (mp->
sw_ifs[i]);
790 for (i = 0; i < num; i++)
792 swif = ntohl (mp->
sw_ifs[i]);
802 rmp->_vl_msg_id = ntohs (VL_API_WANT_PER_INTERFACE_COMBINED_STATS_REPLY);
804 rmp->retval = retval;
824 u32 *sw_if_index = 0;
833 ({ vec_add1 (sm->regs_tmp, reg); }));
868 memset (mp, 0,
sizeof (*mp));
871 ntohs (VL_API_VNET_PER_INTERFACE_COMBINED_COUNTERS);
903 mp->
count = htonl (1);
912 cm = im->combined_sw_if_counters + X; \ 913 vlib_get_combined_counter (cm, reg->item, &v); \ 914 clib_mem_unaligned (&vp->x##_packets, u64) = \ 915 clib_host_to_net_u64 (v.packets); \ 916 clib_mem_unaligned (&vp->x##_bytes, u64) = \ 917 clib_host_to_net_u64 (v.bytes); 949 vl_api_want_per_interface_simple_stats_reply_t *rmp;
954 u32 i, swif, num = 0;
956 num = ntohl (mp->
num);
958 for (i = 0; i < num; i++)
960 swif = ntohl (mp->
sw_ifs[i]);
967 retval = VNET_API_ERROR_INVALID_SW_IF_INDEX;
973 for (i = 0; i < num; i++)
975 swif = ntohl (mp->
sw_ifs[i]);
989 for (i = 0; i < num; i++)
991 swif = ntohl (mp->
sw_ifs[i]);
1002 rmp->_vl_msg_id = ntohs (VL_API_WANT_PER_INTERFACE_SIMPLE_STATS_REPLY);
1004 rmp->retval = retval;
1033 ({ vec_add1 (sm->regs_tmp, reg); }));
1039 if (reg->
item == ~0)
1068 memset (mp, 0,
sizeof (*mp));
1069 mp->_vl_msg_id = ntohs (VL_API_VNET_PER_INTERFACE_SIMPLE_COUNTERS);
1101 mp->
count = htonl (1);
1131 clib_host_to_net_u64 (v);
1167 struct timespec _req, *req = &_req;
1168 struct timespec _rem, *rem = &_rem;
1171 req->tv_nsec = nsec;
1174 if (nanosleep (req, rem) == 0)
1216 vl_counter->
packets = clib_host_to_net_u64 (adj_counter.
packets);
1217 vl_counter->
bytes = clib_host_to_net_u64 (adj_counter.
bytes);
1224 #define MIN(x,y) (((x)<(y))?(x):(y)) 1251 mp->_vl_msg_id = ntohs (VL_API_VNET_IP4_NBR_COUNTERS);
1252 mp->
count = ntohl (n_items);
1264 n_items * sizeof (*ctx->
counters));
1302 ctx.sw_if_index = si->sw_if_index;
1308 ASSERT(ctx.counters == NULL);
1317 dslock (sm, 0 , 1 );
1318 adj_nbr_walk (si->sw_if_index,
1328 if (NULL != ctx.counters)
1330 ip4_nbr_ship(sm, &ctx);
1370 vl_counter->
bytes = clib_host_to_net_u64(adj_counter.
bytes);
1378 #define MIN(x,y) (((x)<(y))?(x):(y)) 1406 mp->_vl_msg_id = ntohs (VL_API_VNET_IP6_NBR_COUNTERS);
1407 mp->
count = ntohl (n_items);
1419 n_items * sizeof (*ctx->
counters));
1457 ctx.sw_if_index = si->sw_if_index;
1463 ASSERT(ctx.counters == NULL);
1472 dslock (sm, 0 , 1 );
1473 adj_nbr_walk (si->sw_if_index,
1483 if (NULL != ctx.counters)
1485 ip6_nbr_ship(sm, &ctx);
1503 u32 items_this_message;
1505 u32 start_at_fib_index = 0;
1514 ({vec_add1(do_fibs->fibs,fib);}));
1520 fib = do_fibs->
fibs[j];
1522 while ((fib - im4->
fibs) < start_at_fib_index)
1533 mp->_vl_msg_id = ntohs (VL_API_VNET_IP4_FIB_COUNTERS);
1558 x.address_length =
i;
1566 p = do_fibs->
pvec[k];
1567 x.address.data_u32 = p->
key;
1568 x.index = p->
value[0];
1573 start_at_fib_index = fib - im4->
fibs;
1603 ctrp->
address = r->address.as_u32;
1606 ctrp->
bytes = clib_host_to_net_u64 (c.
bytes);
1610 if (mp->
count == items_this_message)
1612 mp->
count = htonl (items_this_message);
1636 mp->_vl_msg_id = ntohs (VL_API_VNET_IP4_FIB_COUNTERS);
1644 start_at_fib_index = fib - im4->
fibs;
1695 u32 items_this_message;
1697 u32 start_at_mfib_index = 0;
1709 mfib = do_fibs->
mfibs[j];
1711 while ((mfib - im4->
mfibs) < start_at_mfib_index)
1720 mp->_vl_msg_id = ntohs (VL_API_VNET_IP4_MFIB_COUNTERS);
1773 ctrp->
bytes = clib_host_to_net_u64 (c.
bytes);
1777 if (mp->
count == items_this_message)
1779 mp->
count = htonl (items_this_message);
1801 mp->_vl_msg_id = ntohs (VL_API_VNET_IP4_MFIB_COUNTERS);
1834 u32 items_this_message;
1836 u32 start_at_mfib_index = 0;
1848 mfib = do_fibs->
mfibs[j];
1850 while ((mfib - im6->
mfibs) < start_at_mfib_index)
1859 mp->_vl_msg_id = ntohs (VL_API_VNET_IP6_MFIB_COUNTERS);
1912 ctrp->
bytes = clib_host_to_net_u64 (c.
bytes);
1916 if (mp->
count == items_this_message)
1918 mp->
count = htonl (items_this_message);
1940 mp->_vl_msg_id = ntohs (VL_API_VNET_IP6_MFIB_COUNTERS);
1986 r->
index = kvp->value;
2001 u32 items_this_message;
2003 u32 start_at_fib_index = 0;
2013 ({vec_add1(do_fibs->fibs,fib);}));
2019 fib = do_fibs->
fibs[
i];
2021 while ((fib - im6->
fibs) < start_at_fib_index)
2030 mp->_vl_msg_id = ntohs (VL_API_VNET_IP6_FIB_COUNTERS);
2047 start_at_fib_index = fib - im6->
fibs;
2077 ctrp->
bytes = clib_host_to_net_u64 (c.
bytes);
2081 if (mp->
count == items_this_message)
2083 mp->
count = htonl (items_this_message);
2107 mp->_vl_msg_id = ntohs (VL_API_VNET_IP6_FIB_COUNTERS);
2116 start_at_fib_index = fib - im6->
fibs;
2199 mp->_vl_msg_id = ntohs (VL_API_VNET_UDP_ENCAP_COUNTERS);
2200 mp->
count = ntohl (n_items);
2209 n_items * sizeof (*ctx->
stats));
2249 if (!poller_delay_sec)
2251 return VNET_API_ERROR_INVALID_ARGUMENT;
2267 if (
unformat (input,
"interval %u", &sec))
2273 "`stats_set_poller_delay' API call failed, rv=%d:%U",
2308 rmp->_vl_msg_id = ntohs (VL_API_WANT_PER_INTERFACE_SIMPLE_STATS_REPLY);
2328 pthread_sigmask (SIG_SETMASK, &s, 0);
2388 mp_size =
sizeof (*mp) + (ntohl (mp->
count) *
sizeof (
u64));
2394 for (i = 0; i <
vec_len (clients); i++)
2396 client = clients[
i];
2420 fformat (stdout,
"%U\n", format_vnet_simple_counters, mp);
2443 mp_size =
sizeof (*mp_copy) +
2449 for (i = 0; i <
vec_len (clients); i++)
2451 client = clients[
i];
2493 mp_size =
sizeof (*mp_copy) +
2499 for (i = 0; i <
vec_len (clients); i++)
2501 client = clients[
i];
2544 mp_size =
sizeof (*mp_copy) +
2550 for (i = 0; i <
vec_len (clients); i++)
2552 client = clients[
i];
2595 mp_size =
sizeof (*mp_copy) +
2601 for (i = 0; i <
vec_len (clients); i++)
2603 client = clients[
i];
2641 vl_api_want_udp_encap_stats_reply_t *rmp;
2664 rmp->_vl_msg_id = ntohs (VL_API_WANT_UDP_ENCAP_STATS_REPLY);
2666 rmp->retval = retval;
2676 vl_api_want_stats_reply_t *rmp;
2710 rmp->_vl_msg_id = ntohs (VL_API_WANT_STATS_REPLY);
2712 rmp->retval = retval;
2723 vl_api_want_interface_simple_stats_reply_t *rmp;
2748 rmp->_vl_msg_id = ntohs (VL_API_WANT_INTERFACE_SIMPLE_STATS_REPLY);
2750 rmp->retval = retval;
2761 vl_api_want_ip4_fib_stats_reply_t *rmp;
2785 rmp->_vl_msg_id = ntohs (VL_API_WANT_IP4_FIB_STATS_REPLY);
2787 rmp->retval = retval;
2797 vl_api_want_ip4_mfib_stats_reply_t *rmp;
2820 rmp->_vl_msg_id = ntohs (VL_API_WANT_IP4_MFIB_STATS_REPLY);
2822 rmp->retval = retval;
2832 vl_api_want_ip4_fib_stats_reply_t *rmp;
2855 rmp->_vl_msg_id = ntohs (VL_API_WANT_IP6_FIB_STATS_REPLY);
2857 rmp->retval = retval;
2867 vl_api_want_ip4_mfib_stats_reply_t *rmp;
2890 rmp->_vl_msg_id = ntohs (VL_API_WANT_IP6_MFIB_STATS_REPLY);
2892 rmp->retval = retval;
2926 rmp->_vl_msg_id = ntohs (VL_API_VNET_GET_SUMMARY_STATS_REPLY);
2930 memset (total_pkts, 0,
sizeof (total_pkts));
2931 memset (total_bytes, 0,
sizeof (total_bytes));
2942 total_pkts[which] += v.
packets;
2943 total_bytes[which] += v.
bytes;
2977 #define vl_api_vnet_interface_simple_counters_t_endian vl_noop_handler 2978 #define vl_api_vnet_interface_simple_counters_t_print vl_noop_handler 2979 #define vl_api_vnet_interface_combined_counters_t_endian vl_noop_handler 2980 #define vl_api_vnet_interface_combined_counters_t_print vl_noop_handler 2981 #define vl_api_vnet_ip4_fib_counters_t_endian vl_noop_handler 2982 #define vl_api_vnet_ip4_fib_counters_t_print vl_noop_handler 2983 #define vl_api_vnet_ip6_fib_counters_t_endian vl_noop_handler 2984 #define vl_api_vnet_ip6_fib_counters_t_print vl_noop_handler 2985 #define vl_api_vnet_ip4_nbr_counters_t_endian vl_noop_handler 2986 #define vl_api_vnet_ip4_nbr_counters_t_print vl_noop_handler 2987 #define vl_api_vnet_ip6_nbr_counters_t_endian vl_noop_handler 2988 #define vl_api_vnet_ip6_nbr_counters_t_print vl_noop_handler 3008 vl_msg_api_set_handlers(VL_API_##N, #n, \ 3009 vl_api_##n##_t_handler, \ 3011 vl_api_##n##_t_endian, \ 3012 vl_api_##n##_t_print, \ 3013 sizeof(vl_api_##n##_t), 0 ); 3032 #define stats_reg(n) \ 3033 sm->stats_registrations[IDX_##n] = 0; \ 3034 sm->stats_registration_hash[IDX_##n] = 0; 3035 #include <vpp/stats/stats.reg> 3049 .no_data_structure_clone = 1,
#define IP4_MFIB_COUNTER_BATCH_SIZE
static void vl_api_stats_get_poller_delay_t_handler(vl_api_stats_get_poller_delay_t *mp)
void udp_encap_walk(udp_encap_walk_cb_t cb, void *ctx)
Walk each of the encap objects.
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
static void vl_api_vnet_get_summary_stats_t_handler(vl_api_vnet_get_summary_stats_t *mp)
static void udp_encap_ship(udp_encap_stats_walk_t *ctx)
Want Interface Simple Stats, register for detailed interface stats.
static void stats_thread_fn(void *arg)
static int set_client_for_stat(u32 reg, u32 item, vpe_client_registration_t *client)
#define vec_foreach_index(var, v)
Iterate over vector indices.
vpe_client_registration_t ** clients_tmp
Want Stats, enable/disable ALL stats updates.
vlib_combined_counter_main_t lbm_to_counters
ip46_address_t fp_src_addr
#define hash_set(h, key, value)
fib_node_index_t mfib_table_lookup(u32 fib_index, const mfib_prefix_t *prefix)
Perfom a longest prefix match in the non-forwarding table.
u32 vlib_simple_counter_n_counters(const vlib_simple_counter_main_t *cm)
The number of counters (not the number of per-thread counters)
do_ip46_fibs_t do_ip46_fibs
vl_api_vlib_counter_t data[count]
The UDP encap represenation.
int svm_queue_is_full(svm_queue_t *q)
vl_api_vnet_combined_counter_t data[count]
vpe_client_registration_t * clients
#define hash_unset(h, key)
vl_api_vnet_simple_counter_t data[count]
vl_api_ip6_mfib_counter_t c[count]
static adj_walk_rc_t ip6_nbr_stats_cb(adj_index_t ai, void *arg)
vnet_main_t * vnet_get_main(void)
static void vl_api_want_interface_simple_stats_t_handler(vl_api_want_interface_simple_stats_t *mp)
vnet_interface_main_t interface_main
static void vl_api_vnet_interface_simple_counters_t_handler(vl_api_vnet_interface_simple_counters_t *mp)
Request for a single block of summary stats.
static f64 vlib_time_now(vlib_main_t *vm)
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
const dpo_id_t * fib_entry_contribute_ip_forwarding(fib_node_index_t fib_entry_index)
u8 * message_bounce
Don't automatically free message buffer vetor.
u32 sw_if_index
The SW IF index all these adjs belong to.
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
struct ip_adjacency_t_::@43::@44 nbr
IP_LOOKUP_NEXT_ARP/IP_LOOKUP_NEXT_REWRITE.
VL_MSG_API_REAPER_FUNCTION(want_stats_reaper)
Combined counter to hold both packets and byte differences.
#define vec_add2(V, P, N)
Add N elements to end of vector V, return pointer to new elements in P.
struct udp_encap_stats_walk_t_ udp_encap_stats_walk_t
vl_api_ip4_nbr_counter_t c[count]
VLIB_REGISTER_THREAD(stats_thread_reg, static)
Want UDP encap Stats, register for continuous stats.
void clib_longjmp(clib_longjmp_t *save, uword return_value)
static void ip46_fib_stats_delay(stats_main_t *sm, u32 sec, u32 nsec)
void handle_client_registration(vpe_client_registration_t *client, u32 stat, u32 item, int enable_disable)
Combined stats counters structure.
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
uword clib_setjmp(clib_longjmp_t *save, uword return_value_not_taken)
void * vl_msg_api_alloc(int nbytes)
static void vl_api_vnet_ip4_fib_counters_t_handler(vl_api_vnet_ip4_fib_counters_t *mp)
static clib_error_t * stats_init(vlib_main_t *vm)
format_function_t format_vnet_sw_if_index_name
void svm_queue_unlock(svm_queue_t *q)
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
union ip_adjacency_t_::@43 sub_type
vnet_link_t ia_link
link/ether-type 1 bytes
static void do_ip6_nbr_counters(stats_main_t *sm)
u32 ue_id
The ID given by the user/client.
static void vl_api_vnet_ip4_nbr_counters_t_handler(vl_api_vnet_ip4_nbr_counters_t *mp)
static f64 vlib_last_vector_length_per_node(vlib_main_t *vm)
static clib_error_t * stats_config(vlib_main_t *vm, unformat_input_t *input)
#define IP6_MFIB_COUNTER_BATCH_SIZE
static int vl_api_can_send_msg(vl_api_registration_t *rp)
volatile u32 release_hint
static counter_t vlib_get_simple_counter(vlib_simple_counter_main_t *cm, u32 index)
Get the value of a simple counter Scrapes the entire set of per-thread counters.
static ip_adjacency_t * adj_get(adj_index_t adj_index)
Get a pointer to an adjacency object from its index.
Combined stats counters structure per interface.
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
static void vl_api_want_ip4_mfib_stats_t_handler(vl_api_want_ip4_mfib_stats_t *mp)
#define VLIB_INIT_FUNCTION(x)
vpe_client_stats_registration_t ** regs_tmp
fib_node_index_t mft_index
Index into FIB vector.
static void do_ip4_fib_counters(stats_main_t *sm)
vlib_combined_counter_main_t * combined_sw_if_counters
enum adj_walk_rc_t_ adj_walk_rc_t
return codes from a adjacency walker callback function
#define hash_foreach(key_var, value_var, h, body)
#define IP6_FIB_COUNTER_BATCH_SIZE
#define clib_error_return(e, args...)
mfib_prefix_t mfe_prefix
The prefix of the route.
struct vl_shmem_hdr_ * shmem_hdr
Binary API shared-memory segment header pointer.
struct mfib_table_t_ * mfibs
Vector of MFIBs.
A collection of simple counters.
static adj_walk_rc_t ip4_nbr_stats_cb(adj_index_t ai, void *arg)
static void vl_api_want_ip6_mfib_stats_t_handler(vl_api_want_ip6_mfib_stats_t *mp)
int stats_set_poller_delay(u32 poller_delay_sec)
void vlib_set_thread_name(char *name)
#define foreach_stats_msg
static void vl_api_want_ip4_fib_stats_t_handler(vl_api_want_ip4_fib_stats_t *mp)
vl_shmem_hdr_t * shmem_hdr
static heap_elt_t * first(heap_header_t *h)
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
struct ip4_nbr_stats_ctx_t_ ip4_nbr_stats_ctx_t
The context passed when collecting adjacency counters.
vl_api_ip4_nbr_counter_t * counters
A vector of ip4 nbr counters.
Want Per Interface simple Stats, register for continuous stats.
static void vl_api_want_per_interface_combined_stats_t_handler(vl_api_want_per_interface_combined_stats_t *mp)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
u32 ** enable_all_client_reg(u32 **registrations)
counter_t packets
packet counter
static void vl_api_want_ip6_fib_stats_t_handler(vl_api_want_ip6_fib_stats_t *mp)
void svm_queue_lock(svm_queue_t *q)
static void vl_api_want_ip4_nbr_stats_t_handler(vl_api_want_ip4_nbr_stats_t *mp)
u32 vlib_combined_counter_n_counters(const vlib_combined_counter_main_t *cm)
The number of counters (not the number of per-thread counters)
static void vl_api_want_ip6_nbr_stats_t_handler(vl_api_want_ip6_nbr_stats_t *mp)
#define pool_put(P, E)
Free an object E in pool P.
static void vl_api_want_udp_encap_stats_t_handler(vl_api_want_udp_encap_stats_t *mp)
Stat for one UDP encap object.
vlib_combined_counter_main_t repm_counters
#define VLIB_CONFIG_FUNCTION(x, n,...)
vlib_simple_counter_main_t * sw_if_counters
load_balance_main_t load_balance_main
The one instance of load-balance main.
static u8 * format_vnet_api_errno(u8 *s, va_list *args)
static void ip4_nbr_ship(stats_main_t *sm, ip4_nbr_stats_ctx_t *ctx)
#define SIMPLE_COUNTER_BATCH_SIZE
#define COMBINED_COUNTER_BATCH_SIZE
vl_api_ip6_nbr_counter_t * counters
A vector of ip6 nbr counters.
vlib_combined_counter_main_t adjacency_counters
Adjacency packet counters.
static void do_simple_interface_counters(stats_main_t *sm)
static mfib_entry_t * mfib_entry_get(fib_node_index_t index)
The context passed when collecting adjacency counters.
API main structure, used by both vpp and binary API clients.
int clear_client_for_stat(u32 reg, u32 item, u32 client_index)
#define pool_free(p)
Free a pool.
An API client registration, only in vpp/vlib.
void clib_bihash_foreach_key_value_pair(clib_bihash *h, void *callback, void *arg)
Visit active (key,value) pairs in a bi-hash table.
u8 * format_vnet_interface_combined_counters(u8 *s, va_list *args)
u32 sw_if_index
The SW IF index all these adjs belong to.
fib_node_index_t ft_index
Index into FIB vector.
void mfib_table_walk(u32 fib_index, fib_protocol_t proto, mfib_table_walk_fn_t fn, void *ctx)
Walk all entries in a FIB table N.B: This is NOT safe to deletes.
static void add_routes_in_fib(BVT(clib_bihash_kv)*kvp, void *arg)
void vl_msg_api_send_shmem(svm_queue_t *q, u8 *elem)
static vpe_client_registration_t * get_client_for_stat(u32 reg, u32 item, u32 client_index)
static_always_inline uword vlib_get_thread_index(void)
u32 ft_table_id
Table ID (hash key) for this FIB.
static void vlib_get_combined_counter(const vlib_combined_counter_main_t *cm, u32 index, vlib_counter_t *result)
Get the value of a combined counter, never called in the speed path Scrapes the entire set of per-thr...
static void do_udp_encap_counters(stats_main_t *sm)
#define vec_free(V)
Free vector's memory (no header).
#define IP4_FIB_COUNTER_BATCH_SIZE
static void * clib_mem_set_heap(void *heap)
Want Interface Combined Stats, register for continuous stats.
#define clib_warning(format, args...)
This table stores the routes that are used to forward traffic.
#define clib_memcpy(a, b, c)
static void vnet_interface_counter_unlock(vnet_interface_main_t *im)
u32 fib_node_index_t
A typedef of a node index.
static void vl_api_vnet_ip6_fib_counters_t_handler(vl_api_vnet_ip6_fib_counters_t *mp)
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
Want IP6 FIB Stats, register for continuous stats.
u32 adj_index_t
An index for adjacencies.
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
vl_api_ip6_fib_counter_t c[count]
Simple per interface stats counters structure.
svm_queue_t * vl_input_queue
Aggregrate type for a prefix.
static void clear_one_client(u32 reg_index, u32 reg, u32 item, u32 client_index)
static void vnet_interface_counter_lock(vnet_interface_main_t *im)
struct ip6_nbr_stats_ctx_t_ ip6_nbr_stats_ctx_t
The context passed when collecting adjacency counters.
void stats_dslock_with_hint(int hint, int tag)
static void ip6_nbr_ship(stats_main_t *sm, ip6_nbr_stats_ctx_t *ctx)
#define STATS_RELEASE_DELAY_NS
The context passed when collecting adjacency counters.
static void setup_message_id_table(api_main_t *am)
uword ** stats_registration_hash
#define UDP_ENCAP_COUNTER_BATCH_SIZE
const dpo_id_t * mfib_entry_contribute_ip_forwarding(fib_node_index_t mfib_entry_index)
int stats_memclnt_delete_callback(u32 client_index)
static void do_combined_interface_counters(stats_main_t *sm)
vpe_client_stats_registration_t ** stats_registrations
struct mfib_table_t_ * mfibs
Vector of MFIBs.
Combined interface counter data type for vnet_interface_combined_counters.
u64 counter_t
64bit counters
u32 mft_table_id
Table ID (hash key) for this FIB.
Simple stats counters structure.
vl_api_udp_encap_counter_t c[count]
Want IP6 NBR Stats, register for continuous stats.
static int udp_encap_stats_walk_cb(index_t uei, void *arg)
void udp_encap_get_stats(index_t uei, u64 *packets, u64 *bytes)
u32 stats_poll_interval_in_seconds
ip6_fib_table_instance_t ip6_table[IP6_FIB_NUM_TABLES]
The two FIB tables; fwding and non-fwding.
Get delay between polling statistics.
void vl_msg_api_free(void *)
vl_api_ip4_fib_counter_t c[count]
counter_t bytes
byte counter
Want IP4 FIB Stats, register for continuous stats.
data_structure_lock_t * data_structure_lock
u32 ** init_client_reg(u32 **registrations)
struct udp_encap_stat_t_ udp_encap_stat_t
index_t dpoi_index
the index of objects of that type
Want IP6 multicast FIB Stats, register for continuous stats.
#define FIB_NODE_INDEX_INVALID
struct ip4_fib_t_ * v4_fibs
Vector of MTries.
u8 * format_vnet_interface_simple_counters(u8 *s, va_list *args)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
vpe_client_registration_t * get_clients_for_stat(u32 reg, u32 item)
vnet_interface_main_t * interface_main
static void vl_api_want_stats_t_handler(vl_api_want_stats_t *mp)
#define hash_foreach_pair(p, v, body)
Iterate over hash pairs.
static void clear_client_reg(u32 **registrations)
static void do_ip4_mfib_counters(stats_main_t *sm)
static int clear_client_for_all_stats(u32 client_index)
vnet_sw_interface_t * sw_interfaces
static int mfib_table_stats_walk_cb(fib_node_index_t fei, void *ctx)
#define clib_unix_warning(format, args...)
replicate_main_t replicate_main
The one instance of replicate main.
A collection of combined counters.
Want Per Interface Combined Stats, register for continuous stats.
uword * fib_entry_by_dst_address[33]
struct _svm_queue svm_queue_t
#define clib_mem_unaligned(pointer, type)
vl_api_ip4_mfib_counter_t c[count]
static void vl_api_vnet_ip6_nbr_counters_t_handler(vl_api_vnet_ip6_nbr_counters_t *mp)
static void * clib_mem_alloc_aligned(uword size, uword align)
static void do_ip6_fib_counters(stats_main_t *sm)
static void do_simple_per_interface_counters(stats_main_t *sm)
A protocol Independent IP multicast FIB table.
ip4_main_t ip4_main
Global ip4 main structure.
static vlib_thread_main_t * vlib_get_thread_main()
static void do_ip6_mfib_counters(stats_main_t *sm)
Reply for vnet_get_summary_stats request.
struct fib_table_t_ * fibs
Vector of FIBs.
Get delay between polling statistics reply.
#define vec_foreach(var, vec)
Vector iterator.
Want IP4 NBR Stats, register for continuous stats.
static void vl_api_want_interface_combined_stats_t_handler(vl_api_want_interface_combined_stats_t *mp)
void * vlib_worker_thread_bootstrap_fn(void *arg)
#define CLIB_MEMORY_BARRIER()
static void do_combined_per_interface_counters(stats_main_t *sm)
static void vl_api_vnet_interface_combined_counters_t_handler(vl_api_vnet_interface_combined_counters_t *mp)
void * vl_msg_api_alloc_as_if_client(int nbytes)
void stats_dsunlock(int hint, int tag)
u16 fp_len
The mask length.
#define CLIB_CACHE_LINE_BYTES
static clib_error_t * want_stats_reaper(u32 client_index)
struct fib_table_t_ * fibs
void vl_msg_api_send_shmem_nolock(svm_queue_t *q, u8 *elem)
static void vl_api_want_per_interface_simple_stats_t_handler(vl_api_want_per_interface_simple_stats_t *mp)
static void dsunlock(stats_main_t *sm)
static void do_ip4_nbr_counters(stats_main_t *sm)
static void dslock(stats_main_t *sm, int release_hint, int tag)
Simple interface counter data type for vnet_interface_simple_counters.
static udp_encap_t * udp_encap_get(index_t uei)
vl_api_ip6_nbr_counter_t c[count]
Want IP4 muilticast FIB Stats, register for continuous stats.
ip46_address_t fp_grp_addr
The address type is not deriveable from the fp_addr member.
A protocol Independent FIB table.
static uword pool_elts(void *v)
Number of active elements in a pool.