|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
22 #define foreach_pppoe_cp_next \
23 _(DROP, "error-drop") \
24 _(INTERFACE, "interface-output" ) \
28 #define _(s,n) PPPOE_CP_NEXT_##s,
52 s =
format (s,
"PPPoE dispatch from sw_if_index %d next %d error %d \n"
53 " pppoe_code 0x%x ppp_proto 0x%x",
59 s =
format (s,
"PPPoE dispatch from cp_if_index %d next %d error %d \n"
60 " pppoe_code 0x%x ppp_proto 0x%x",
75 u32 pkts_decapsulated = 0;
77 u32 stats_sw_if_index, stats_n_packets, stats_n_bytes;
86 cached_result.
raw = ~0;
89 stats_sw_if_index =
node->runtime_data[0];
90 stats_n_packets = stats_n_bytes = 0;
97 to_next, n_left_to_next);
111 u32 rx_sw_if_index0=~0, tx_sw_if_index0=~0, len0;
129 error0 = PPPOE_ERROR_BAD_VER_TYPE;
130 next0 = PPPOE_INPUT_NEXT_DROP;
141 &key0, &bucket0, &result0);
142 tx_sw_if_index0 = result0.
fields.sw_if_index;
146 error0 = PPPOE_ERROR_NO_SUCH_SESSION;
147 next0 = PPPOE_INPUT_NEXT_DROP;
151 next0 = PPPOE_CP_NEXT_INTERFACE;
166 &key0, &bucket0, &result0);
167 tx_sw_if_index0 = result0.
fields.sw_if_index;
174 next0 = PPPOE_CP_NEXT_INTERFACE;
180 pkts_decapsulated ++;
181 stats_n_packets += 1;
182 stats_n_bytes += len0;
188 stats_n_packets -= 1;
189 stats_n_bytes -= len0;
194 stats_n_packets, stats_n_bytes);
196 stats_n_bytes = len0;
197 stats_sw_if_index = rx_sw_if_index0;
201 b0->
error = error0 ?
node->errors[error0] : 0;
215 to_next, n_left_to_next,
223 PPPOE_ERROR_DECAPSULATED,
231 thread_index, stats_sw_if_index, stats_n_packets, stats_n_bytes);
232 node->runtime_data[0] = stats_sw_if_index;
239 .name =
"pppoe-cp-dispatch",
241 .vector_size =
sizeof (
u32),
248 #define _(s,n) [PPPOE_CP_NEXT_##s] = n,
#define foreach_pppoe_cp_next
vnet_interface_main_t * im
char * pppoe_error_strings[]
vnet_sw_interface_type_t type
static u8 * format_pppoe_cp_trace(u8 *s, va_list *args)
nat44_ei_hairpin_src_next_t next_index
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
vlib_main_t vlib_node_runtime_t * node
@ VNET_SW_INTERFACE_TYPE_SUB
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static vnet_sw_interface_t * vnet_get_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
vlib_main_t vlib_node_runtime_t vlib_frame_t * from_frame
static_always_inline void pppoe_learn_process(BVT(clib_bihash) *table, u32 sw_if_index0, pppoe_entry_key_t *key0, pppoe_entry_key_t *cached_key, u32 *bucket0, pppoe_entry_result_t *result0)
Perform learning on one packet based on the mac table lookup result.
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
static_always_inline void * clib_memcpy_fast(void *restrict dst, const void *restrict src, size_t n)
vlib_node_registration_t pppoe_input_node
(constructor) VLIB_REGISTER_NODE (pppoe_input_node)
vlib_error_t error
Error code for buffers to be enqueued to error handler.
#define VLIB_NODE_FN(node)
static vnet_hw_interface_t * vnet_get_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
static_always_inline uword vlib_get_thread_index(void)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
@ VNET_INTERFACE_COUNTER_RX
struct _vlib_node_registration vlib_node_registration_t
vlib_combined_counter_main_t * combined_sw_if_counters
static_always_inline void pppoe_lookup_1(BVT(clib_bihash) *table, pppoe_entry_key_t *cached_key, pppoe_entry_result_t *cached_result, u8 *mac0, u16 session_id0, pppoe_entry_key_t *key0, u32 *bucket0, pppoe_entry_result_t *result0)
#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.
description fragment has unexpected format
struct pppoe_entry_result_t::@776::@778 fields
vlib_put_next_frame(vm, node, next_index, 0)
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
vlib_node_registration_t pppoe_cp_dispatch_node
(constructor) VLIB_REGISTER_NODE (pppoe_cp_dispatch_node)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
static void vlib_buffer_reset(vlib_buffer_t *b)
Reset current header & length to state they were in when packet was received.
#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).
vnet_interface_main_t interface_main
vlib_increment_combined_counter(ccm, ti, sw_if_index, n_buffers, n_bytes)
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
VLIB buffer representation.
#define VLIB_REGISTER_NODE(x,...)