31 #define f64_print(a,b) 42 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 47 #define foreach_stats_msg \ 48 _(WANT_STATS, want_stats) \ 49 _(VNET_INTERFACE_SIMPLE_COUNTERS, vnet_interface_simple_counters) \ 50 _(WANT_INTERFACE_SIMPLE_STATS, want_interface_simple_stats) \ 51 _(VNET_INTERFACE_COMBINED_COUNTERS, vnet_interface_combined_counters) \ 52 _(WANT_INTERFACE_COMBINED_STATS, want_interface_combined_stats) \ 53 _(WANT_PER_INTERFACE_COMBINED_STATS, want_per_interface_combined_stats) \ 54 _(WANT_PER_INTERFACE_SIMPLE_STATS, want_per_interface_simple_stats) \ 55 _(VNET_IP4_FIB_COUNTERS, vnet_ip4_fib_counters) \ 56 _(WANT_IP4_FIB_STATS, want_ip4_fib_stats) \ 57 _(VNET_IP6_FIB_COUNTERS, vnet_ip6_fib_counters) \ 58 _(WANT_IP6_FIB_STATS, want_ip6_fib_stats) \ 59 _(WANT_IP4_MFIB_STATS, want_ip4_mfib_stats) \ 60 _(WANT_IP6_MFIB_STATS, want_ip6_mfib_stats) \ 61 _(VNET_IP4_NBR_COUNTERS, vnet_ip4_nbr_counters) \ 62 _(WANT_IP4_NBR_STATS, want_ip4_nbr_stats) \ 63 _(VNET_IP6_NBR_COUNTERS, vnet_ip6_nbr_counters) \ 64 _(WANT_IP6_NBR_STATS, want_ip6_nbr_stats) \ 65 _(VNET_GET_SUMMARY_STATS, vnet_get_summary_stats) 68 #define vl_msg_name_crc_list 69 #include <vpp/stats/stats.api.h> 70 #undef vl_msg_name_crc_list 76 vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 77 foreach_vl_msg_name_crc_stats;
82 #define SIMPLE_COUNTER_BATCH_SIZE 126 83 #define COMBINED_COUNTER_BATCH_SIZE 63 84 #define IP4_FIB_COUNTER_BATCH_SIZE 48 85 #define IP6_FIB_COUNTER_BATCH_SIZE 30 86 #define IP4_MFIB_COUNTER_BATCH_SIZE 24 87 #define IP6_MFIB_COUNTER_BATCH_SIZE 15 90 #define STATS_RELEASE_DELAY_NS (1000 * 1000 * 5) 103 count = ntohl (mp->
count);
119 counter_name =
"bogus";
122 for (i = 0; i <
count; i++)
125 packets = clib_net_to_host_u64 (packets);
127 bytes = clib_net_to_host_u64 (bytes);
129 s =
format (s,
"%U.%s.packets %lld\n",
131 sm->
vnet_main, sw_if_index, counter_name, packets);
132 s =
format (s,
"%U.%s.bytes %lld\n",
134 sm->
vnet_main, sw_if_index, counter_name, bytes);
148 count = ntohl (mp->
count);
157 counter_name =
"drop";
160 counter_name =
"punt";
163 counter_name =
"ip4";
166 counter_name =
"ip6";
169 counter_name =
"rx-no-buff";
172 counter_name =
"rx-miss";
175 counter_name =
"rx-error (fifo-full)";
178 counter_name =
"tx-error (fifo-full)";
181 counter_name =
"bogus";
187 v = clib_net_to_host_u64 (v);
190 sm->
vnet_main, sw_if_index, counter_name, v);
216 while (__sync_lock_test_and_set (&l->
lock, 1))
296 registration->
item = item;
383 vec_add1 (clients, *client);}
395 #define stats_reg(n) vec_free(registrations[IDX_##n]); 396 #include <vpp/stats/stats.reg> 416 #define stats_reg(n) \ 417 vec_reset_length(registrations[IDX_##n]); 418 #include <vpp/stats/stats.reg> 425 return registrations;
437 #define stats_reg(n) \ 438 vec_add1(registrations[IDX_##n], ~0); 439 #include <vpp/stats/stats.reg> 441 return registrations;
453 u32 items_this_message = 0;
466 for (i = 0; i < n_counts; i++)
474 (
sizeof (*mp) + items_this_message *
sizeof (v));
475 mp->_vl_msg_id = ntohs (VL_API_VNET_INTERFACE_SIMPLE_COUNTERS);
485 if (mp->
count == items_this_message)
487 mp->
count = htonl (items_this_message);
500 u32 item,
int enable_disable)
508 if (enable_disable == 0)
544 vl_api_want_interface_combined_stats_reply_t *rmp;
569 rmp->_vl_msg_id = ntohs (VL_API_WANT_INTERFACE_COMBINED_STATS_REPLY);
571 rmp->retval = retval;
593 for (i = 0; i <
vec_len (clients); i++)
599 if (q_prev && (q_prev->cursize < q_prev->maxsize))
610 fformat (stdout,
"%U\n", format_vnet_combined_counters, mp);
613 if (q_prev && (q_prev->cursize < q_prev->maxsize))
632 u32 items_this_message = 0;
641 for (i = 0; i < n_counts; i++)
649 (
sizeof (*mp) + items_this_message *
sizeof (v));
650 mp->_vl_msg_id = ntohs (VL_API_VNET_INTERFACE_COMBINED_COUNTERS);
658 = clib_host_to_net_u64 (v.
packets);
662 if (mp->
count == items_this_message)
664 mp->
count = htonl (items_this_message);
686 vl_api_want_per_interface_combined_stats_reply_t *rmp;
695 for (i = 0; i < mp->
num; i++)
704 retval = VNET_API_ERROR_INVALID_SW_IF_INDEX;
710 for (i = 0; i < mp->
num; i++)
725 for (i = 0; i < mp->
num; i++)
736 rmp->_vl_msg_id = ntohs (VL_API_WANT_PER_INTERFACE_COMBINED_STATS_REPLY);
738 rmp->retval = retval;
763 u32 items_this_message = 1;
770 u32 *sw_if_index = 0;
797 vec_add1 (sm->regs_tmp, reg);}));
812 vec_add1 (sm->clients_tmp,
833 (items_this_message *
839 ntohs (VL_API_VNET_PER_INTERFACE_COMBINED_COUNTERS);
841 mp->
count = items_this_message;
850 = clib_host_to_net_u64 (v.
packets);
852 clib_host_to_net_u64 (v.
bytes);
859 = clib_host_to_net_u64 (v.
packets);
861 clib_host_to_net_u64 (v.
bytes);
881 vl_api_want_per_interface_simple_stats_reply_t *rmp;
889 for (i = 0; i < mp->
num; i++)
898 retval = VNET_API_ERROR_INVALID_SW_IF_INDEX;
904 for (i = 0; i < mp->
num; i++)
920 for (i = 0; i < mp->
num; i++)
933 rmp->_vl_msg_id = ntohs (VL_API_WANT_PER_INTERFACE_SIMPLE_STATS_REPLY);
935 rmp->retval = retval;
960 u32 items_this_message = 1;
1000 if (reg->
item == ~0)
1010 vec_add1 (sm->clients_tmp,
1030 size = (
sizeof (*mp) + (items_this_message * (
sizeof (
u64) * 10)));
1034 mp->_vl_msg_id = ntohs (VL_API_VNET_PER_INTERFACE_SIMPLE_COUNTERS);
1036 mp->
count = items_this_message;
1067 clib_host_to_net_u64 (v);
1103 struct timespec _req, *req = &_req;
1104 struct timespec _rem, *rem = &_rem;
1107 req->tv_nsec = nsec;
1110 if (nanosleep (req, rem) == 0)
1152 vl_counter->
packets = clib_host_to_net_u64 (adj_counter.
packets);
1153 vl_counter->
bytes = clib_host_to_net_u64 (adj_counter.
bytes);
1160 #define MIN(x,y) (((x)<(y))?(x):(y)) 1187 mp->_vl_msg_id = ntohs (VL_API_VNET_IP4_NBR_COUNTERS);
1188 mp->
count = ntohl (n_items);
1200 n_items * sizeof (*ctx->
counters));
1238 ctx.sw_if_index = si->sw_if_index;
1244 ASSERT(ctx.counters == NULL);
1253 dslock (sm, 0 , 1 );
1254 adj_nbr_walk (si->sw_if_index,
1264 if (NULL != ctx.counters)
1266 ip4_nbr_ship(sm, &ctx);
1306 vl_counter->
bytes = clib_host_to_net_u64(adj_counter.
bytes);
1314 #define MIN(x,y) (((x)<(y))?(x):(y)) 1342 mp->_vl_msg_id = ntohs (VL_API_VNET_IP6_NBR_COUNTERS);
1343 mp->
count = ntohl (n_items);
1355 n_items * sizeof (*ctx->
counters));
1393 ctx.sw_if_index = si->sw_if_index;
1399 ASSERT(ctx.counters == NULL);
1408 dslock (sm, 0 , 1 );
1409 adj_nbr_walk (si->sw_if_index,
1419 if (NULL != ctx.counters)
1421 ip6_nbr_ship(sm, &ctx);
1439 u32 items_this_message;
1441 u32 start_at_fib_index = 0;
1450 ({vec_add1(do_fibs->fibs,fib);}));
1456 fib = do_fibs->
fibs[j];
1458 while ((fib - im4->
fibs) < start_at_fib_index)
1469 mp->_vl_msg_id = ntohs (VL_API_VNET_IP4_FIB_COUNTERS);
1494 x.address_length =
i;
1502 p = do_fibs->
pvec[k];
1503 x.address.data_u32 = p->
key;
1504 x.index = p->
value[0];
1509 start_at_fib_index = fib - im4->
fibs;
1539 ctrp->
address = r->address.as_u32;
1542 ctrp->
bytes = clib_host_to_net_u64 (c.
bytes);
1546 if (mp->
count == items_this_message)
1548 mp->
count = htonl (items_this_message);
1572 mp->_vl_msg_id = ntohs (VL_API_VNET_IP4_FIB_COUNTERS);
1580 start_at_fib_index = fib - im4->
fibs;
1631 u32 items_this_message;
1633 u32 start_at_mfib_index = 0;
1645 mfib = do_fibs->
mfibs[j];
1647 while ((mfib - im4->
mfibs) < start_at_mfib_index)
1656 mp->_vl_msg_id = ntohs (VL_API_VNET_IP4_MFIB_COUNTERS);
1709 ctrp->
bytes = clib_host_to_net_u64 (c.
bytes);
1713 if (mp->
count == items_this_message)
1715 mp->
count = htonl (items_this_message);
1737 mp->_vl_msg_id = ntohs (VL_API_VNET_IP4_MFIB_COUNTERS);
1770 u32 items_this_message;
1772 u32 start_at_mfib_index = 0;
1784 mfib = do_fibs->
mfibs[j];
1786 while ((mfib - im6->
mfibs) < start_at_mfib_index)
1795 mp->_vl_msg_id = ntohs (VL_API_VNET_IP6_MFIB_COUNTERS);
1848 ctrp->
bytes = clib_host_to_net_u64 (c.
bytes);
1852 if (mp->
count == items_this_message)
1854 mp->
count = htonl (items_this_message);
1876 mp->_vl_msg_id = ntohs (VL_API_VNET_IP6_MFIB_COUNTERS);
1922 r->
index = kvp->value;
1937 u32 items_this_message;
1939 u32 start_at_fib_index = 0;
1949 ({vec_add1(do_fibs->fibs,fib);}));
1955 fib = do_fibs->
fibs[
i];
1957 while ((fib - im6->
fibs) < start_at_fib_index)
1966 mp->_vl_msg_id = ntohs (VL_API_VNET_IP6_FIB_COUNTERS);
1983 start_at_fib_index = fib - im6->
fibs;
2013 ctrp->
bytes = clib_host_to_net_u64 (c.
bytes);
2017 if (mp->
count == items_this_message)
2019 mp->
count = htonl (items_this_message);
2043 mp->_vl_msg_id = ntohs (VL_API_VNET_IP6_FIB_COUNTERS);
2052 start_at_fib_index = fib - im6->
fibs;
2088 pthread_sigmask (SIG_SETMASK, &s, 0);
2145 mp_size =
sizeof (*mp) + (ntohl (mp->
count) *
sizeof (
u64));
2151 for (i = 0; i <
vec_len (clients); i++)
2153 client = clients[
i];
2157 if (q_prev && (q_prev->cursize < q_prev->maxsize))
2176 fformat (stdout,
"%U\n", format_vnet_simple_counters, mp);
2179 if (q_prev && (q_prev->cursize < q_prev->maxsize))
2199 mp_size =
sizeof (*mp_copy) +
2205 for (i = 0; i <
vec_len (clients); i++)
2207 client = clients[
i];
2211 if (q_prev && (q_prev->cursize < q_prev->maxsize))
2228 if (q_prev && (q_prev->cursize < q_prev->maxsize))
2248 mp_size =
sizeof (*mp_copy) +
2254 for (i = 0; i <
vec_len (clients); i++)
2256 client = clients[
i];
2260 if (q_prev && (q_prev->cursize < q_prev->maxsize))
2278 if (q_prev && (q_prev->cursize < q_prev->maxsize))
2298 mp_size =
sizeof (*mp_copy) +
2304 for (i = 0; i <
vec_len (clients); i++)
2306 client = clients[
i];
2310 if (q_prev && (q_prev->cursize < q_prev->maxsize))
2327 if (q_prev && (q_prev->cursize < q_prev->maxsize))
2347 mp_size =
sizeof (*mp_copy) +
2353 for (i = 0; i <
vec_len (clients); i++)
2355 client = clients[
i];
2359 if (q_prev && (q_prev->cursize < q_prev->maxsize))
2376 if (q_prev && (q_prev->cursize < q_prev->maxsize))
2391 vl_api_want_stats_reply_t *rmp;
2426 rmp->_vl_msg_id = ntohs (VL_API_WANT_STATS_REPLY);
2428 rmp->retval = retval;
2439 vl_api_want_interface_simple_stats_reply_t *rmp;
2464 rmp->_vl_msg_id = ntohs (VL_API_WANT_INTERFACE_SIMPLE_STATS_REPLY);
2466 rmp->retval = retval;
2477 vl_api_want_ip4_fib_stats_reply_t *rmp;
2501 rmp->_vl_msg_id = ntohs (VL_API_WANT_IP4_FIB_STATS_REPLY);
2503 rmp->retval = retval;
2513 vl_api_want_ip4_mfib_stats_reply_t *rmp;
2537 rmp->_vl_msg_id = ntohs (VL_API_WANT_IP4_MFIB_STATS_REPLY);
2539 rmp->retval = retval;
2549 vl_api_want_ip4_fib_stats_reply_t *rmp;
2573 rmp->_vl_msg_id = ntohs (VL_API_WANT_IP6_FIB_STATS_REPLY);
2575 rmp->retval = retval;
2585 vl_api_want_ip4_mfib_stats_reply_t *rmp;
2609 rmp->_vl_msg_id = ntohs (VL_API_WANT_IP6_MFIB_STATS_REPLY);
2611 rmp->retval = retval;
2648 rmp->_vl_msg_id = ntohs (VL_API_VNET_GET_SUMMARY_STATS_REPLY);
2652 memset (total_pkts, 0,
sizeof (total_pkts));
2653 memset (total_bytes, 0,
sizeof (total_bytes));
2664 total_pkts[which] += v.
packets;
2665 total_bytes[which] += v.
bytes;
2699 #define vl_api_vnet_interface_simple_counters_t_endian vl_noop_handler 2700 #define vl_api_vnet_interface_simple_counters_t_print vl_noop_handler 2701 #define vl_api_vnet_interface_combined_counters_t_endian vl_noop_handler 2702 #define vl_api_vnet_interface_combined_counters_t_print vl_noop_handler 2703 #define vl_api_vnet_ip4_fib_counters_t_endian vl_noop_handler 2704 #define vl_api_vnet_ip4_fib_counters_t_print vl_noop_handler 2705 #define vl_api_vnet_ip6_fib_counters_t_endian vl_noop_handler 2706 #define vl_api_vnet_ip6_fib_counters_t_print vl_noop_handler 2707 #define vl_api_vnet_ip4_nbr_counters_t_endian vl_noop_handler 2708 #define vl_api_vnet_ip4_nbr_counters_t_print vl_noop_handler 2709 #define vl_api_vnet_ip6_nbr_counters_t_endian vl_noop_handler 2710 #define vl_api_vnet_ip6_nbr_counters_t_print vl_noop_handler 2730 vl_msg_api_set_handlers(VL_API_##N, #n, \ 2731 vl_api_##n##_t_handler, \ 2733 vl_api_##n##_t_endian, \ 2734 vl_api_##n##_t_print, \ 2735 sizeof(vl_api_##n##_t), 0 ); 2754 #define stats_reg(n) \ 2755 sm->stats_registrations[IDX_##n] = 0; \ 2756 sm->stats_registration_hash[IDX_##n] = 0; 2757 #include <vpp/stats/stats.reg> 2771 .no_data_structure_clone = 1,
#define IP4_MFIB_COUNTER_BATCH_SIZE
#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)
Want Interface Simple Stats, register for detailed interface stats.
static void stats_thread_fn(void *arg)
void * vl_msg_api_alloc_as_if_client(int nbytes)
static int set_client_for_stat(u32 reg, u32 item, vpe_client_registration_t *client)
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
sll srl srl sll sra u16x4 i
vl_api_vlib_counter_t data[count]
vl_api_vnet_combined_counter_t data[count]
vpe_client_registration_t * clients
#define hash_unset(h, key)
int unix_shared_memory_queue_is_full(unix_shared_memory_queue_t *q)
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)
unix_shared_memory_queue_t * vl_input_queue
Request for a single block of summary stats.
static f64 vlib_time_now(vlib_main_t *vm)
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.
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
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.
vl_api_ip4_nbr_counter_t c[count]
VLIB_REGISTER_THREAD(stats_thread_reg, static)
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)
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
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
vnet_link_t ia_link
link/ether-type 1 bytes
static void do_ip6_nbr_counters(stats_main_t *sm)
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 IP6_MFIB_COUNTER_BATCH_SIZE
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 IP6_FIB_COUNTER_BATCH_SIZE
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)
void vlib_set_thread_name(char *name)
void * vl_msg_api_alloc(int nbytes)
#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)
struct ip_adjacency_t_::@38::@39 nbr
IP_LOOKUP_NEXT_ARP/IP_LOOKUP_NEXT_REWRITE.
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)
void vl_msg_api_free(void *)
#define pool_put(P, E)
Free an object E in pool P.
vlib_combined_counter_main_t repm_counters
vlib_simple_counter_main_t * sw_if_counters
load_balance_main_t load_balance_main
The one instance of load-balance main.
static void ip4_nbr_ship(stats_main_t *sm, ip4_nbr_stats_ctx_t *ctx)
#define SIMPLE_COUNTER_BATCH_SIZE
void unix_shared_memory_queue_lock(unix_shared_memory_queue_t *q)
#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)
union ip_adjacency_t_::@38 sub_type
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)
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...
#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)
unix_shared_memory_queue_t * vl_api_client_index_to_input_queue(u32 index)
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.
vl_api_ip6_fib_counter_t c[count]
Simple per interface stats counters structure.
Aggregrate type for a prefix.
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 vl_msg_api_send_shmem(unix_shared_memory_queue_t *q, u8 *elem)
void stats_dslock_with_hint(int hint, int tag)
u64 tx_packets
packet counter
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
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.
u64 counter_t
64bit counters
u32 mft_table_id
Table ID (hash key) for this FIB.
Simple stats counters structure.
Want IP6 NBR Stats, register for continuous stats.
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.
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.
void vl_msg_api_send_shmem_nolock(unix_shared_memory_queue_t *q, u8 *elem)
#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)
void unix_shared_memory_queue_unlock(unix_shared_memory_queue_t *q)
#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)
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]
#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.
#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 stats_dsunlock(int hint, int tag)
u16 fp_len
The mask length.
#define CLIB_CACHE_LINE_BYTES
struct fib_table_t_ * fibs
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)
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.
struct _unix_shared_memory_queue unix_shared_memory_queue_t
u64 rx_packets
packet counter
static uword pool_elts(void *v)
Number of active elements in a pool.