|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
21 #include <sys/ioctl.h>
32 #define foreach_mrvl_pp2_input_error \
33 _(PPIO_RECV, "pp2_ppio_recv error") \
34 _(BPOOL_GET_NUM_BUFFS, "pp2_bpool_get_num_buffs error") \
35 _(BPOOL_PUT_BUFFS, "pp2_bpool_put_buffs error") \
36 _(BUFFER_ALLOC, "buffer alloc error") \
37 _(MAC_CE, "MAC error (CRC error)") \
38 _(MAC_OR, "overrun error") \
39 _(MAC_RSVD, "unknown MAC error") \
40 _(MAC_RE, "resource error") \
41 _(IP_HDR, "ip4 header error")
45 #define _(f,s) MRVL_PP2_INPUT_ERROR_##f,
79 len = pp2_ppio_inq_desc_get_pkt_len (d);
81 b->
flags = VLIB_BUFFER_TOTAL_LENGTH_VALID | add_flags;
83 if (add_flags & VNET_BUFFER_F_L2_HDR_OFFSET_VALID)
86 if (add_flags & VNET_BUFFER_F_L3_HDR_OFFSET_VALID)
99 if (add_flags & VNET_BUFFER_F_L3_HDR_OFFSET_VALID)
101 DM_RXD_GET_IPHDR_LEN (d) * 4;
115 u8 ec = DM_RXD_GET_EC (d);
117 b->
error =
node->errors[MRVL_PP2_INPUT_ERROR_MAC_CE];
119 b->
error =
node->errors[MRVL_PP2_INPUT_ERROR_MAC_OR];
121 b->
error =
node->errors[MRVL_PP2_INPUT_ERROR_MAC_RSVD];
123 b->
error =
node->errors[MRVL_PP2_INPUT_ERROR_MAC_RE];
126 l3_info = DM_RXD_GET_L3_PRS_INFO (d);
134 b->
error =
node->errors[MRVL_PP2_INPUT_ERROR_IP_HDR];
140 VNET_BUFFER_F_L2_HDR_OFFSET_VALID |
141 VNET_BUFFER_F_L3_HDR_OFFSET_VALID |
142 VNET_BUFFER_F_L4_HDR_OFFSET_VALID | VNET_BUFFER_F_IS_IP4);
151 VNET_BUFFER_F_L2_HDR_OFFSET_VALID |
152 VNET_BUFFER_F_L3_HDR_OFFSET_VALID |
153 VNET_BUFFER_F_L4_HDR_OFFSET_VALID | VNET_BUFFER_F_IS_IP6);
158 VNET_BUFFER_F_L2_HDR_OFFSET_VALID);
175 u32 n_rx_packets = 0;
178 struct pp2_ppio_desc *d;
191 n_rx_packets = n_desc;
193 for (
i = 0;
i < n_desc;
i++)
207 while (n_desc >= 4 && n_left_to_next >= 2)
252 n_left_to_next, bi0, bi1, next0,
256 while (n_desc && n_left_to_next)
258 u32 bi0 = buffers[0];
288 n_left_to_next, bi0, next0);
293 interface_main.combined_sw_if_counters +
301 MRVL_PP2_INPUT_ERROR_BPOOL_GET_NUM_BUFFS, 1);
305 n_bufs = inq->
size - n_bufs;
309 struct buff_release_entry *e = ptd->
bre;
318 MRVL_PP2_INPUT_ERROR_BUFFER_ALLOC, 1);
328 e->bpool = inq->
bpool;
337 MRVL_PP2_INPUT_ERROR_BPOOL_PUT_BUFFS, 1);
377 .name =
"mrvl-pp2-input",
378 .sibling_of =
"device-input",
381 .state = VLIB_NODE_STATE_POLLING,
static void vlib_buffer_free(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Free buffers Frees the entire buffer chain for each buffer.
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
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.
@ VNET_DEVICE_INPUT_NEXT_DROP
vlib_main_t vlib_node_runtime_t * node
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
u32 per_interface_next_index
mrvl_pp2_main_t mrvl_pp2_main
static u32 vlib_get_trace_count(vlib_main_t *vm, vlib_node_runtime_t *rt)
static uword vlib_buffer_get_pa(vlib_main_t *vm, vlib_buffer_t *b)
@ VNET_DEVICE_INPUT_NEXT_ETHERNET_INPUT
static void vlib_error_count(vlib_main_t *vm, uword node_index, uword counter, uword increment)
static_always_inline void * clib_memcpy_fast(void *restrict dst, const void *restrict src, size_t n)
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
vlib_error_t error
Error code for buffers to be enqueued to error handler.
static_always_inline void vnet_feature_start_device_input_x2(u32 sw_if_index, u32 *next0, u32 *next1, vlib_buffer_t *b0, vlib_buffer_t *b1)
#define MRVL_PP2_BUFF_BATCH_SZ
static __clib_warn_unused_result u32 vlib_buffer_alloc(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Allocate buffers into supplied array.
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
vnet_main_t * vnet_get_main(void)
@ VNET_DEVICE_INPUT_NEXT_IP6_INPUT
struct clib_bihash_value offset
template key/value backing page structure
u32 buffers[VLIB_FRAME_SIZE]
#define vec_validate_aligned(V, I, A)
Make sure vector is long enough for given index (no header, specified alignment)
#define static_always_inline
struct pp2_ppio_desc * descs
sll srl srl sll sra u16x4 i
#define VLIB_NODE_FLAG_TRACE_SUPPORTED
@ VNET_INTERFACE_COUNTER_RX
#define CLIB_CACHE_LINE_BYTES
static void vlib_set_trace_count(vlib_main_t *vm, vlib_node_runtime_t *rt, u32 count)
struct _vlib_node_registration vlib_node_registration_t
u16 current_length
Nbytes between current data and the end of this buffer.
@ VNET_DEVICE_INPUT_NEXT_IP4_NCS_INPUT
struct buff_release_entry bre[MRVL_PP2_BUFF_BATCH_SZ]
#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.
template key/value backing page structure
mrvl_pp2_if_t * interfaces
vlib_put_next_frame(vm, node, next_index, 0)
static_always_inline vnet_hw_if_rxq_poll_vector_t * vnet_hw_if_get_rxq_poll_vector(vlib_main_t *vm, vlib_node_runtime_t *node)
mrvl_pp2_per_thread_data_t * per_thread_data
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
static_always_inline void vnet_feature_start_device_input_x1(u32 sw_if_index, u32 *next0, vlib_buffer_t *b0)
format_function_t format_mrvl_pp2_input_trace
#define vlib_validate_buffer_enqueue_x2(vm, node, next_index, to_next, n_left_to_next, bi0, bi1, next0, next1)
Finish enqueueing two buffers forward in the graph.
static __clib_warn_unused_result int vlib_trace_buffer(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, vlib_buffer_t *b, int follow_chain)
u32 total_length_not_including_first_buffer
Only valid for first buffer in chain.
vl_api_interface_index_t sw_if_index
#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 MRVL_PP2_IF_F_ADMIN_UP
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,...)