38 s =
format (s,
"P2P ethernet: %U -> %U",
45 #define foreach_p2p_ethernet_error \ 46 _(HITS, "P2P ethernet incoming packets processed") 50 #define _(sym,str) P2PE_ERROR_##sym, 57 #define _(sym,string) string, 68 u32 n_left_from, *from, *to_next;
70 u32 n_p2p_ethernet_packets = 0;
78 while (n_left_from > 0)
84 while (n_left_from >= 4 && n_left_to_next >= 2)
88 u32 next0 = 0, next1 = 0;
89 u32 sw_if_index0, sw_if_index1;
120 n_p2p_ethernet_packets += 1;
141 n_p2p_ethernet_packets += 1;
161 to_next, n_left_to_next,
164 to_next, n_left_to_next,
168 while (n_left_from > 0 && n_left_to_next > 0)
196 n_p2p_ethernet_packets += 1;
223 to_next, n_left_to_next,
230 P2PE_ERROR_HITS, n_p2p_ethernet_packets);
237 .name =
"p2p-ethernet-input",
238 .vector_size =
sizeof (
u32),
static u32 vlib_get_trace_count(vlib_main_t *vm, vlib_node_runtime_t *rt)
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.
vnet_main_t * vnet_get_main(void)
vnet_interface_main_t interface_main
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
format_function_t format_vnet_sw_if_index_name
static void vlib_trace_buffer(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, vlib_buffer_t *b, int follow_chain)
vlib_combined_counter_main_t * combined_sw_if_counters
#define VLIB_NODE_FUNCTION_MULTIARCH(node, fn)
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).
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
The fine-grained event logger allows lightweight, thread-safe event logging at minimum cost...
u32 p2p_ethernet_lookup(u32 parent_if_index, u8 *client_mac)
#define VLIB_REGISTER_NODE(x,...)
static_always_inline uword vlib_get_thread_index(void)
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.
u16 cached_next_index
Next frame index that vector arguments were last enqueued to last time this node ran.
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
struct _vlib_node_registration vlib_node_registration_t
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
A collection of combined counters.
u16 flags
Copy of main node flags.
static void vlib_set_trace_count(vlib_main_t *vm, vlib_node_runtime_t *rt, u32 count)
#define VLIB_NODE_FLAG_TRACE
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.