40 return (VNET_API_ERROR_INVALID_VALUE);
47 return (VNET_API_ERROR_FEATURE_DISABLED);
51 sw_if_index, enable, 0, 0);
53 sw_if_index, enable, 0, 0);
67 #define inc_counter(ctype, rx_tx) \ 77 u32 n_left_from, *from, *to_next;
87 while (n_left_from > 0)
93 while (n_left_from > 0 && n_left_to_next > 0)
101 to_next[0] = bi0 = from[0];
122 stats_n_packets[b0_ctype] += 1;
127 n_left_to_next, bi0, next0);
137 sw_if_index, stats_n_packets[ct], stats_n_bytes[ct]);
147 sw_if_index, stats_n_packets[ct], stats_n_bytes[ct]);
173 .vector_size =
sizeof (
u32),
179 .name =
"stats-collect-rx",
183 .vector_size =
sizeof (
u32),
189 .name =
"stats-collect-tx",
196 .arc_name =
"device-input",
197 .node_name =
"stats-collect-rx",
202 .arc_name =
"interface-output",
203 .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)
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
static int eh_dst_addr_to_rx_ctype(ethernet_header_t *eh)
#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)
VLIB_NODE_FUNCTION_MULTIARCH(stats_collect_rx_node, stats_collect_rx)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
static_always_inline void vnet_feature_next(u32 sw_if_index, u32 *next0, vlib_buffer_t *b0)
#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)
#define foreach_tx_combined_interface_counter(_x)
VNET_FEATURE_INIT(stats_collect_rx_node, static)
static int eh_dst_addr_to_tx_ctype(ethernet_header_t *eh)
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 uword stats_collect_rx(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
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)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
vnet_sw_interface_type_t type
static uword stats_collect_tx(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
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)
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)