35 #define f64_print(a,b) 46 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 51 #define foreach_stats_msg \ 52 _(WANT_STATS, want_stats) \ 53 _(VNET_INTERFACE_SIMPLE_COUNTERS, vnet_interface_simple_counters) \ 54 _(WANT_INTERFACE_SIMPLE_STATS, want_interface_simple_stats) \ 55 _(VNET_INTERFACE_COMBINED_COUNTERS, vnet_interface_combined_counters) \ 56 _(WANT_INTERFACE_COMBINED_STATS, want_interface_combined_stats) \ 57 _(WANT_PER_INTERFACE_COMBINED_STATS, want_per_interface_combined_stats) \ 58 _(WANT_PER_INTERFACE_SIMPLE_STATS, want_per_interface_simple_stats) \ 59 _(VNET_IP4_FIB_COUNTERS, vnet_ip4_fib_counters) \ 60 _(WANT_IP4_FIB_STATS, want_ip4_fib_stats) \ 61 _(VNET_IP6_FIB_COUNTERS, vnet_ip6_fib_counters) \ 62 _(WANT_IP6_FIB_STATS, want_ip6_fib_stats) \ 63 _(WANT_IP4_MFIB_STATS, want_ip4_mfib_stats) \ 64 _(WANT_IP6_MFIB_STATS, want_ip6_mfib_stats) \ 65 _(VNET_IP4_NBR_COUNTERS, vnet_ip4_nbr_counters) \ 66 _(WANT_IP4_NBR_STATS, want_ip4_nbr_stats) \ 67 _(VNET_IP6_NBR_COUNTERS, vnet_ip6_nbr_counters) \ 68 _(WANT_IP6_NBR_STATS, want_ip6_nbr_stats) \ 69 _(VNET_GET_SUMMARY_STATS, vnet_get_summary_stats) \ 70 _(STATS_GET_POLLER_DELAY, stats_get_poller_delay) \ 71 _(WANT_UDP_ENCAP_STATS, want_udp_encap_stats) \ 72 _(WANT_BIER_NEIGHBOR_STATS, want_bier_neighbor_stats) 74 #define vl_msg_name_crc_list 75 #include <vpp/stats/stats.api.h> 76 #undef vl_msg_name_crc_list 82 vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 83 foreach_vl_msg_name_crc_stats;
88 #define SIMPLE_COUNTER_BATCH_SIZE 126 89 #define COMBINED_COUNTER_BATCH_SIZE 63 90 #define IP4_FIB_COUNTER_BATCH_SIZE 48 91 #define IP6_FIB_COUNTER_BATCH_SIZE 30 92 #define IP4_MFIB_COUNTER_BATCH_SIZE 24 93 #define IP6_MFIB_COUNTER_BATCH_SIZE 15 94 #define UDP_ENCAP_COUNTER_BATCH_SIZE (1024 / sizeof(vl_api_udp_encap_counter_t)) 95 #define BIER_NEIGHBOR_COUNTER_BATCH_SIZE (1024 / sizeof(vl_api_bier_neighbor_counter_t)) 98 #define STATS_RELEASE_DELAY_NS (1000 * 1000 * 5) 111 count = ntohl (mp->
count);
127 counter_name =
"bogus";
130 for (i = 0; i <
count; i++)
133 packets = clib_net_to_host_u64 (packets);
135 bytes = clib_net_to_host_u64 (bytes);
137 s =
format (s,
"%U.%s.packets %lld\n",
139 sm->
vnet_main, sw_if_index, counter_name, packets);
140 s =
format (s,
"%U.%s.bytes %lld\n",
142 sm->
vnet_main, sw_if_index, counter_name, bytes);
156 count = ntohl (mp->
count);
165 counter_name =
"drop";
168 counter_name =
"punt";
171 counter_name =
"ip4";
174 counter_name =
"ip6";
177 counter_name =
"rx-no-buff";
180 counter_name =
"rx-miss";
183 counter_name =
"rx-error (fifo-full)";
186 counter_name =
"tx-error (fifo-full)";
189 counter_name =
"bogus";
195 v = clib_net_to_host_u64 (v);
198 sm->
vnet_main, sw_if_index, counter_name, v);
224 while (__sync_lock_test_and_set (&l->
lock, 1))
304 registration->
item = item;
388 u32 reg_index, item, reg;
396 clear_one_client(reg_index, reg, item, client_index);
448 vec_add1 (clients, *client);}
461 #define stats_reg(n) vec_free(registrations[IDX_##n]); 462 #include <vpp/stats/stats.reg> 482 #define stats_reg(n) \ 483 vec_reset_length(registrations[IDX_##n]); 484 #include <vpp/stats/stats.reg> 491 return registrations;
503 #define stats_reg(n) \ 504 vec_add1(registrations[IDX_##n], ~0); 505 #include <vpp/stats/stats.reg> 507 return registrations;
519 u32 items_this_message = 0;
532 for (i = 0; i < n_counts; i++)
540 (
sizeof (*mp) + items_this_message *
sizeof (v));
541 mp->_vl_msg_id = ntohs (VL_API_VNET_INTERFACE_SIMPLE_COUNTERS);
551 if (mp->
count == items_this_message)
553 mp->
count = htonl (items_this_message);
566 u32 item,
int enable_disable)
574 if (enable_disable == 0)
610 vl_api_want_interface_combined_stats_reply_t *rmp;
634 rmp->_vl_msg_id = ntohs (VL_API_WANT_INTERFACE_COMBINED_STATS_REPLY);
636 rmp->retval = retval;
658 for (i = 0; i <
vec_len (clients); i++)
676 fformat (stdout,
"%U\n", format_vnet_combined_counters, mp);
698 u32 items_this_message = 0;
707 for (i = 0; i < n_counts; i++)
715 (
sizeof (*mp) + items_this_message *
sizeof (v));
716 mp->_vl_msg_id = ntohs (VL_API_VNET_INTERFACE_COMBINED_COUNTERS);
724 = clib_host_to_net_u64 (v.
packets);
728 if (mp->
count == items_this_message)
730 mp->
count = htonl (items_this_message);
752 vl_api_want_per_interface_combined_stats_reply_t *rmp;
757 u32 i, swif, num = 0;
759 num = ntohl (mp->
num);
764 for (i = 0; i < num; i++)
766 swif = ntohl (mp->
sw_ifs[i]);
775 retval = VNET_API_ERROR_INVALID_SW_IF_INDEX;
781 for (i = 0; i < num; i++)
783 swif = ntohl (mp->
sw_ifs[i]);
795 for (i = 0; i < num; i++)
797 swif = ntohl (mp->
sw_ifs[i]);
807 rmp->_vl_msg_id = ntohs (VL_API_WANT_PER_INTERFACE_COMBINED_STATS_REPLY);
809 rmp->retval = retval;
829 u32 *sw_if_index = 0;
838 ({ vec_add1 (sm->regs_tmp, reg); }));
873 memset (mp, 0,
sizeof (*mp));
876 ntohs (VL_API_VNET_PER_INTERFACE_COMBINED_COUNTERS);
908 mp->
count = htonl (1);
917 cm = im->combined_sw_if_counters + X; \ 918 vlib_get_combined_counter (cm, reg->item, &v); \ 919 clib_mem_unaligned (&vp->x##_packets, u64) = \ 920 clib_host_to_net_u64 (v.packets); \ 921 clib_mem_unaligned (&vp->x##_bytes, u64) = \ 922 clib_host_to_net_u64 (v.bytes); 954 vl_api_want_per_interface_simple_stats_reply_t *rmp;
959 u32 i, swif, num = 0;
961 num = ntohl (mp->
num);
963 for (i = 0; i < num; i++)
965 swif = ntohl (mp->
sw_ifs[i]);
972 retval = VNET_API_ERROR_INVALID_SW_IF_INDEX;
978 for (i = 0; i < num; i++)
980 swif = ntohl (mp->
sw_ifs[i]);
994 for (i = 0; i < num; i++)
996 swif = ntohl (mp->
sw_ifs[i]);
1007 rmp->_vl_msg_id = ntohs (VL_API_WANT_PER_INTERFACE_SIMPLE_STATS_REPLY);
1009 rmp->retval = retval;
1038 ({ vec_add1 (sm->regs_tmp, reg); }));
1044 if (reg->
item == ~0)
1073 memset (mp, 0,
sizeof (*mp));
1074 mp->_vl_msg_id = ntohs (VL_API_VNET_PER_INTERFACE_SIMPLE_COUNTERS);
1106 mp->
count = htonl (1);
1136 clib_host_to_net_u64 (v);
1172 struct timespec _req, *req = &_req;
1173 struct timespec _rem, *rem = &_rem;
1176 req->tv_nsec = nsec;
1179 if (nanosleep (req, rem) == 0)
1221 vl_counter->
packets = clib_host_to_net_u64 (adj_counter.
packets);
1222 vl_counter->
bytes = clib_host_to_net_u64 (adj_counter.
bytes);
1229 #define MIN(x,y) (((x)<(y))?(x):(y)) 1273 mp->_vl_msg_id = ntohs (VL_API_VNET_IP4_NBR_COUNTERS);
1274 mp->
count = ntohl (n_items);
1286 n_items * sizeof (*ctx->
counters));
1315 ctx.sw_if_index = si->sw_if_index;
1321 ASSERT(ctx.counters == NULL);
1330 dslock (sm, 0 , 1 );
1331 adj_nbr_walk (si->sw_if_index,
1341 if (NULL != ctx.counters)
1343 ip4_nbr_ship(sm, &ctx);
1383 vl_counter->
bytes = clib_host_to_net_u64(adj_counter.
bytes);
1391 #define MIN(x,y) (((x)<(y))?(x):(y)) 1419 mp->_vl_msg_id = ntohs (VL_API_VNET_IP6_NBR_COUNTERS);
1420 mp->
count = ntohl (n_items);
1432 n_items * sizeof (*ctx->
counters));
1461 ctx.sw_if_index = si->sw_if_index;
1467 ASSERT(ctx.counters == NULL);
1476 dslock (sm, 0 , 1 );
1477 adj_nbr_walk (si->sw_if_index,
1487 if (NULL != ctx.counters)
1489 ip6_nbr_ship(sm, &ctx);
1507 u32 items_this_message;
1509 u32 start_at_fib_index = 0;
1518 ({vec_add1(do_fibs->fibs,fib);}));
1524 fib = do_fibs->
fibs[j];
1526 while ((fib - im4->
fibs) < start_at_fib_index)
1537 mp->_vl_msg_id = ntohs (VL_API_VNET_IP4_FIB_COUNTERS);
1562 x.address_length =
i;
1570 p = do_fibs->
pvec[k];
1571 x.address.data_u32 = p->
key;
1572 x.index = p->
value[0];
1577 start_at_fib_index = fib - im4->
fibs;
1607 ctrp->
address = r->address.as_u32;
1610 ctrp->
bytes = clib_host_to_net_u64 (c.
bytes);
1614 if (mp->
count == items_this_message)
1616 mp->
count = htonl (items_this_message);
1640 mp->_vl_msg_id = ntohs (VL_API_VNET_IP4_FIB_COUNTERS);
1648 start_at_fib_index = fib - im4->
fibs;
1699 u32 items_this_message;
1701 u32 start_at_mfib_index = 0;
1713 mfib = do_fibs->
mfibs[j];
1715 while ((mfib - im4->
mfibs) < start_at_mfib_index)
1724 mp->_vl_msg_id = ntohs (VL_API_VNET_IP4_MFIB_COUNTERS);
1777 ctrp->
bytes = clib_host_to_net_u64 (c.
bytes);
1781 if (mp->
count == items_this_message)
1783 mp->
count = htonl (items_this_message);
1805 mp->_vl_msg_id = ntohs (VL_API_VNET_IP4_MFIB_COUNTERS);
1838 u32 items_this_message;
1840 u32 start_at_mfib_index = 0;
1852 mfib = do_fibs->
mfibs[j];
1854 while ((mfib - im6->
mfibs) < start_at_mfib_index)
1863 mp->_vl_msg_id = ntohs (VL_API_VNET_IP6_MFIB_COUNTERS);
1916 ctrp->
bytes = clib_host_to_net_u64 (c.
bytes);
1920 if (mp->
count == items_this_message)
1922 mp->
count = htonl (items_this_message);
1944 mp->_vl_msg_id = ntohs (VL_API_VNET_IP6_MFIB_COUNTERS);
1990 r->
index = kvp->value;
2005 u32 items_this_message;
2007 u32 start_at_fib_index = 0;
2017 ({vec_add1(do_fibs->fibs,fib);}));
2023 fib = do_fibs->
fibs[
i];
2025 while ((fib - im6->
fibs) < start_at_fib_index)
2034 mp->_vl_msg_id = ntohs (VL_API_VNET_IP6_FIB_COUNTERS);
2051 start_at_fib_index = fib - im6->
fibs;
2081 ctrp->
bytes = clib_host_to_net_u64 (c.
bytes);
2085 if (mp->
count == items_this_message)
2087 mp->
count = htonl (items_this_message);
2111 mp->_vl_msg_id = ntohs (VL_API_VNET_IP6_FIB_COUNTERS);
2120 start_at_fib_index = fib - im6->
fibs;
2197 mp->_vl_msg_id = ntohs (VL_API_VNET_UDP_ENCAP_COUNTERS);
2198 mp->
count = ntohl (n_items);
2207 n_items * sizeof (*ctx->
stats));
2291 mp->_vl_msg_id = ntohs (VL_API_VNET_BIER_NEIGHBOR_COUNTERS);
2292 mp->
count = ntohl (n_items);
2301 n_items * sizeof (*ctx->
stats));
2332 if (!poller_delay_sec)
2334 return VNET_API_ERROR_INVALID_ARGUMENT;
2390 template.file_descriptor = s->fd;
2391 template.description =
2408 else if (
unformat (input,
"default"))
2410 else if (
unformat (input,
"interval %u", &sec))
2416 "`stats_set_poller_delay' API call failed, rv=%d:%U",
2454 rmp->_vl_msg_id = ntohs (VL_API_WANT_PER_INTERFACE_SIMPLE_STATS_REPLY);
2474 pthread_sigmask (SIG_SETMASK, &s, 0);
2536 mp_size =
sizeof (*mp) + (ntohl (mp->
count) *
sizeof (
u64));
2542 for (i = 0; i <
vec_len (clients); i++)
2544 client = clients[
i];
2568 fformat (stdout,
"%U\n", format_vnet_simple_counters, mp);
2591 mp_size =
sizeof (*mp_copy) +
2597 for (i = 0; i <
vec_len (clients); i++)
2599 client = clients[
i];
2641 mp_size =
sizeof (*mp_copy) +
2647 for (i = 0; i <
vec_len (clients); i++)
2649 client = clients[
i];
2692 mp_size =
sizeof (*mp_copy) +
2698 for (i = 0; i <
vec_len (clients); i++)
2700 client = clients[
i];
2743 mp_size =
sizeof (*mp_copy) +
2749 for (i = 0; i <
vec_len (clients); i++)
2751 client = clients[
i];
2789 vl_api_want_udp_encap_stats_reply_t *rmp;
2812 rmp->_vl_msg_id = ntohs (VL_API_WANT_UDP_ENCAP_STATS_REPLY);
2814 rmp->retval = retval;
2825 vl_api_want_bier_neighbor_stats_reply_t *rmp;
2849 rmp->_vl_msg_id = ntohs (VL_API_WANT_BIER_NEIGHBOR_STATS_REPLY);
2851 rmp->retval = retval;
2861 vl_api_want_stats_reply_t *rmp;
2895 rmp->_vl_msg_id = ntohs (VL_API_WANT_STATS_REPLY);
2897 rmp->retval = retval;
2908 vl_api_want_interface_simple_stats_reply_t *rmp;
2933 rmp->_vl_msg_id = ntohs (VL_API_WANT_INTERFACE_SIMPLE_STATS_REPLY);
2935 rmp->retval = retval;
2946 vl_api_want_ip4_fib_stats_reply_t *rmp;
2970 rmp->_vl_msg_id = ntohs (VL_API_WANT_IP4_FIB_STATS_REPLY);
2972 rmp->retval = retval;
2982 vl_api_want_ip4_mfib_stats_reply_t *rmp;
3005 rmp->_vl_msg_id = ntohs (VL_API_WANT_IP4_MFIB_STATS_REPLY);
3007 rmp->retval = retval;
3017 vl_api_want_ip4_fib_stats_reply_t *rmp;
3040 rmp->_vl_msg_id = ntohs (VL_API_WANT_IP6_FIB_STATS_REPLY);
3042 rmp->retval = retval;
3052 vl_api_want_ip4_mfib_stats_reply_t *rmp;
3075 rmp->_vl_msg_id = ntohs (VL_API_WANT_IP6_MFIB_STATS_REPLY);
3077 rmp->retval = retval;
3111 rmp->_vl_msg_id = ntohs (VL_API_VNET_GET_SUMMARY_STATS_REPLY);
3115 memset (total_pkts, 0,
sizeof (total_pkts));
3116 memset (total_bytes, 0,
sizeof (total_bytes));
3127 total_pkts[which] += v.
packets;
3128 total_bytes[which] += v.
bytes;
3162 #define vl_api_vnet_interface_simple_counters_t_endian vl_noop_handler 3163 #define vl_api_vnet_interface_simple_counters_t_print vl_noop_handler 3164 #define vl_api_vnet_interface_combined_counters_t_endian vl_noop_handler 3165 #define vl_api_vnet_interface_combined_counters_t_print vl_noop_handler 3166 #define vl_api_vnet_ip4_fib_counters_t_endian vl_noop_handler 3167 #define vl_api_vnet_ip4_fib_counters_t_print vl_noop_handler 3168 #define vl_api_vnet_ip6_fib_counters_t_endian vl_noop_handler 3169 #define vl_api_vnet_ip6_fib_counters_t_print vl_noop_handler 3170 #define vl_api_vnet_ip4_nbr_counters_t_endian vl_noop_handler 3171 #define vl_api_vnet_ip4_nbr_counters_t_print vl_noop_handler 3172 #define vl_api_vnet_ip6_nbr_counters_t_endian vl_noop_handler 3173 #define vl_api_vnet_ip6_nbr_counters_t_print vl_noop_handler 3193 vl_msg_api_set_handlers(VL_API_##N, #n, \ 3194 vl_api_##n##_t_handler, \ 3196 vl_api_##n##_t_endian, \ 3197 vl_api_##n##_t_print, \ 3198 sizeof(vl_api_##n##_t), 0 ); 3217 #define stats_reg(n) \ 3218 sm->stats_registrations[IDX_##n] = 0; \ 3219 sm->stats_registration_hash[IDX_##n] = 0; 3220 #include <vpp/stats/stats.reg> 3234 .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)
A representation of a fib path for fib_path_encode to convey the information to the caller...
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)
#define BIER_NEIGHBOR_COUNTER_BATCH_SIZE
Request for a single block of summary stats.
static f64 vlib_time_now(vlib_main_t *vm)
vl_api_udp_encap_counter_t * stats
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.
static void vl_api_want_bier_neighbor_stats_t_handler(vl_api_want_bier_neighbor_stats_t *mp)
u32 sw_if_index
The SW IF index all these adjs belong to.
static void send_and_pause(stats_main_t *sm, svm_queue_t *q, u8 *mp)
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]
clib_error_t * clib_socket_init(clib_socket_t *s)
vl_api_bier_table_id_t tbl_id
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)
void bier_fmask_db_walk(bier_fmask_walk_fn_t fn, void *ctx)
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)
vl_api_bier_neighbor_counter_t c[count]
Combined stats counters structure.
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
static void do_bier_neighbor_counters(stats_main_t *sm)
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 walk_rc_t udp_encap_stats_walk_cb(index_t uei, void *arg)
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)
#define CLIB_SOCKET_F_IS_SERVER
static clib_error_t * stats_config(vlib_main_t *vm, unformat_input_t *input)
#define IP6_MFIB_COUNTER_BATCH_SIZE
enum walk_rc_t_ walk_rc_t
Walk return code.
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 void stats_segment_socket_init(void)
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
static clib_error_t * clib_socket_sendmsg(clib_socket_t *s, void *msg, int msglen, int fds[], int num_fds)
bier_table_set_id_t bti_set
The SET-ID The control plane divdies the bit-position space into sets in the case the max bit-positio...
#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.
clib_file_main_t file_main
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
bier_hdr_len_id_t bti_hdr_len
The size of the bit string processed by this table.
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)
clib_error_t * clib_socket_accept(clib_socket_t *server, clib_socket_t *client)
static void vl_api_want_ip4_nbr_stats_t_handler(vl_api_want_ip4_nbr_stats_t *mp)
static clib_error_t * clib_socket_close(clib_socket_t *sock)
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,...)
vl_api_bier_neighbor_counter_t * stats
Stat for one BIER neighbor object.
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)
void do_stat_segment_updates(stats_main_t *sm)
#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.
struct bier_neighbor_stats_walk_t_ bier_neighbor_stats_walk_t
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)
static uword clib_file_add(clib_file_main_t *um, clib_file_t *template)
uword ** stats_registration_hash
#define UDP_ENCAP_COUNTER_BATCH_SIZE
static walk_rc_t bier_neighbor_stats_walk_cb(index_t bfmi, void *arg)
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.
#define clib_error_report(e)
Combined interface counter data type for vnet_interface_combined_counters.
struct _socket_t clib_socket_t
static void bier_neighbor_ship(bier_neighbor_stats_walk_t *ctx)
#define clib_mem_unaligned(pointer, type)
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 void * clib_mem_alloc(uword size)
void udp_encap_get_stats(index_t uei, u64 *packets, u64 *bytes)
#define CLIB_SOCKET_F_SEQPACKET
u32 stats_poll_interval_in_seconds
void fib_api_path_encode(const fib_route_path_encode_t *api_rpath, vl_api_fib_path_t *out)
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)
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
#define STAT_SEGMENT_SOCKET_FILE
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.
void bier_fmask_get_stats(index_t bfmi, u64 *packets, u64 *bytes)
#define CLIB_SOCKET_F_PASSCRED
static void clear_client_reg(u32 **registrations)
bier_table_sub_domain_id_t bti_sub_domain
The Sub-Domain-ID The control plane has the configuration option to specify multiple domains or topol...
static void do_ip4_mfib_counters(stats_main_t *sm)
static int clear_client_for_all_stats(u32 client_index)
Want BIER neighbor Stats, register for continuous stats.
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
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)
static clib_error_t * stats_socket_accept_ready(clib_file_t *uf)
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 bier_fmask_encode(index_t bfmi, bier_table_id_t *btid, fib_route_path_encode_t *rpath)
ssvm_private_t stat_segment
void stats_dsunlock(int hint, int tag)
u16 fp_len
The mask length.
#define CLIB_CACHE_LINE_BYTES
#define CLIB_SOCKET_F_ALLOW_GROUP_WRITE
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.