26 #define foreach_avf_input_error \ 27 _(BUFFER_ALLOC, "buffer alloc error") \ 28 _(RX_PACKET_ERROR, "Rx packet errors") 32 #define _(f,s) AVF_INPUT_ERROR_##f, 44 #define AVF_RX_DESC_STATUS(x) (1 << x) 45 #define AVF_RX_DESC_STATUS_DD AVF_RX_DESC_STATUS(0) 46 #define AVF_RX_DESC_STATUS_EOP AVF_RX_DESC_STATUS(1) 62 #define AVF_INPUT_REFILL_TRESHOLD 32 67 u16 n_refill, mask, n_alloc, slot;
75 slot = (rxq->
next - n_refill - 1) & mask;
84 AVF_INPUT_ERROR_BUFFER_ALLOC, 1);
105 slot = (slot + 1) & mask;
120 b->
error = node->
errors[AVF_INPUT_ERROR_RX_PACKET_ERROR];
139 b->
flags |= ptype->flags;
140 return ptype->next_node;
147 int with_features_or_tracing)
160 u32 n_rx_packets = 0;
172 u16 next_pf = (rxq->
next + 8) & mask;
180 maybe_error |= rxve->
error;
199 if (ad->
flags & AVF_DEVICE_F_IOVA)
204 n_rx_packets = n_rxv;
209 u32 bi0, bi1, bi2, bi3;
211 u32 next0, next1, next2, next3;
215 while (n_rxv >= 12 && n_left_to_next >= 4)
234 to_next[0] = bi0 = rxve[0].
bi;
235 to_next[1] = bi1 = rxve[1].
bi;
236 to_next[2] = bi2 = rxve[2].
bi;
237 to_next[3] = bi3 = rxve[3].
bi;
279 if (with_features_or_tracing)
281 &next1, &next2, &next3,
328 n_left_to_next, bi0, bi1, bi2, bi3,
329 next0, next1, next2, next3);
331 while (n_rxv && n_left_to_next)
343 if (with_features_or_tracing)
366 n_left_to_next, bi0, next0);
391 if ((ad->
flags & AVF_DEVICE_F_ADMIN_UP) == 0)
402 #ifndef CLIB_MULTIARCH_VARIANT 407 .sibling_of =
"device-input",
410 .state = VLIB_NODE_STATE_DISABLED,
418 static void __clib_constructor
static_always_inline int ethernet_frame_is_any_tagged_x4(u16 type0, u16 type1, u16 type2, u16 type3)
static u64 avf_get_u64_bits(void *start, int offset, int first, int last)
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.
static void vlib_buffer_free(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Free buffers Frees the entire buffer chain for each buffer.
vnet_main_t * vnet_get_main(void)
vnet_interface_main_t interface_main
#define clib_error(format, args...)
static void vlib_error_count(vlib_main_t *vm, uword node_index, uword counter, uword increment)
static_always_inline void vnet_feature_start_device_input_x4(u32 sw_if_index, u32 *next0, u32 *next1, u32 *next2, u32 *next3, vlib_buffer_t *b0, vlib_buffer_t *b1, vlib_buffer_t *b2, vlib_buffer_t *b3)
#define vlib_validate_buffer_enqueue_x4(vm, node, next_index, to_next, n_left_to_next, bi0, bi1, bi2, bi3, next0, next1, next2, next3)
Finish enqueueing four buffers forward in the graph.
vlib_error_t * errors
Vector of errors for this node.
format_function_t format_avf_input_trace
static u64 vlib_get_buffer_data_physical_address(vlib_main_t *vm, u32 buffer_index)
static void vlib_trace_buffer(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, vlib_buffer_t *b, int follow_chain)
#define static_always_inline
vlib_combined_counter_main_t * combined_sw_if_counters
static_always_inline int vnet_device_input_have_features(u32 sw_if_index)
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
static uword pointer_to_uword(const void *p)
u16 current_length
Nbytes between current data and the end of this buffer.
u32 node_index
Node index.
#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).
uword( vlib_node_function_t)(struct vlib_main_t *vm, struct vlib_node_runtime_t *node, struct vlib_frame_t *frame)
vlib_error_t error
Error code for buffers to be enqueued to error handler.
#define VLIB_REGISTER_NODE(x,...)
static_always_inline uword vlib_get_thread_index(void)
#define CLIB_PREFETCH(addr, size, type)
#define clib_memcpy(a, b, c)
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.
u32 per_interface_next_index
avf_rx_vector_entry_t rx_vector[AVF_RX_VECTOR_SZ]
static_always_inline int ethernet_frame_is_tagged(u16 type)
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
#define foreach_device_and_queue(var, vec)
static u32 vlib_buffer_alloc_to_ring(vlib_main_t *vm, u32 *ring, u32 start, u32 ring_size, u32 n_buffers)
Allocate buffers into ring.
#define VLIB_BUFFER_TRACE_TRAJECTORY_INIT(b)
avf_per_thread_data_t * per_thread_data
static_always_inline void vnet_feature_start_device_input_x1(u32 sw_if_index, u32 *next0, vlib_buffer_t *b0)
#define CLIB_MEMORY_BARRIER()
static void vlib_set_trace_count(vlib_main_t *vm, vlib_node_runtime_t *rt, u32 count)
#define CLIB_CACHE_LINE_BYTES
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
#define CLIB_MULTIARCH_FN(fn)