23 #ifndef CLIB_MARCH_VARIANT 41 return (VNET_API_ERROR_INVALID_VALUE);
48 return (VNET_API_ERROR_FEATURE_DISABLED);
52 sw_if_index, enable, 0, 0);
54 sw_if_index, enable, 0, 0);
69 #define inc_counter(ctype, rx_tx) \ 79 u32 n_left_from, *from, *to_next;
89 while (n_left_from > 0)
95 while (n_left_from > 0 && n_left_to_next > 0)
103 to_next[0] = bi0 = from[0];
124 stats_n_packets[b0_ctype] += 1;
129 n_left_to_next, bi0, next0);
139 sw_if_index, stats_n_packets[ct], stats_n_bytes[ct]);
149 sw_if_index, stats_n_packets[ct], stats_n_bytes[ct]);
175 .vector_size =
sizeof (
u32),
180 .
name =
"stats-collect-rx",
184 .vector_size =
sizeof (
u32),
189 .
name =
"stats-collect-tx",
193 .arc_name =
"device-input",
194 .node_name =
"stats-collect-rx",
199 .arc_name =
"interface-output",
200 .node_name =
"stats-collect-tx",
vlib_node_registration_t stats_collect_rx_node
(constructor) VLIB_REGISTER_NODE (stats_collect_rx_node)
static u8 * format_stats_collect_trace(u8 *s, va_list *args)
static void vlib_increment_combined_counter(vlib_combined_counter_main_t *cm, u32 thread_index, u32 index, u64 n_packets, u64 n_bytes)
Increment a combined counter.
static_always_inline uword stats_collect_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, vlib_rx_or_tx_t rxtx)
vnet_main_t * vnet_get_main(void)
vnet_interface_main_t interface_main
static vnet_sw_interface_t * vnet_get_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
#define VLIB_NODE_FN(node)
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
ethernet_main_t ethernet_main
#define static_always_inline
#define VLIB_INIT_FUNCTION(x)
vlib_combined_counter_main_t * combined_sw_if_counters
int vnet_sw_interface_stats_collect_enable_disable(u32 sw_if_index, u8 enable)
vl_api_fib_path_type_t type
static int eh_dst_addr_to_tx_ctype(const ethernet_header_t *eh)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
#define vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next, n_left_to_next, bi0, next0)
Finish enqueueing one buffer forward in the graph.
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
Get pointer to next frame vector data by (vlib_node_runtime_t, next_index).
#define VLIB_REGISTER_NODE(x,...)
static_always_inline uword vlib_get_thread_index(void)
static_always_inline void vnet_feature_next(u32 *next0, vlib_buffer_t *b0)
#define foreach_tx_combined_interface_counter(_x)
VNET_FEATURE_INIT(stats_collect_rx_node, static)
void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
Release pointer to next frame vector data.
vnet_interface_counter_type_t
static int eh_dst_addr_to_rx_ctype(const ethernet_header_t *eh)
vlib_main_t vlib_node_runtime_t * node
u16 cached_next_index
Next frame index that vector arguments were last enqueued to last time this node ran.
#define foreach_rx_combined_interface_counter(_x)
#define VNET_FEATURES(...)
ethernet_interface_t * ethernet_get_interface(ethernet_main_t *em, u32 hw_if_index)
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
VLIB buffer representation.
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
vnet_sw_interface_type_t type
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
vlib_node_registration_t stats_collect_tx_node
(constructor) VLIB_REGISTER_NODE (stats_collect_tx_node)
static clib_error_t * stats_collect_init(vlib_main_t *vm)
vl_api_interface_index_t sw_if_index
int vnet_feature_enable_disable(const char *arc_name, const char *node_name, u32 sw_if_index, int enable_disable, void *feature_config, u32 n_feature_config_bytes)