26 #define foreach_vmxnet3_input_error \ 27 _(BUFFER_ALLOC, "buffer alloc error") \ 28 _(RX_PACKET_NO_SOP, "Rx packet error - no SOP") \ 29 _(RX_PACKET, "Rx packet error") \ 30 _(RX_PACKET_EOP, "Rx packet error found on EOP") \ 31 _(NO_BUFFER, "Rx no buffer error") 35 #define _(f,s) VMXNET3_INPUT_ERROR_##f, 53 rid = rx_comp->index & (0xffffffff >> 6);
81 u32 n_rx_packets = 0, n_rx_bytes = 0;
82 vmxnet3_rx_comp *rx_comp;
93 u8 known_next = 0, got_packet = 0;
118 VMXNET3_INPUT_ERROR_NO_BUFFER, 1);
130 rxd = &rxq->
rx_desc[rid][desc_idx];
132 bi0 = ring->
bufs[desc_idx];
133 ring->
bufs[desc_idx] = ~0;
153 VMXNET3_INPUT_ERROR_RX_PACKET_EOP, 1);
171 hb->
flags = VLIB_BUFFER_TOTAL_LENGTH_VALID;
188 prev_b0->
flags |= VLIB_BUFFER_NEXT_PRESENT;
190 hb->total_length_not_including_first_buffer +=
199 VMXNET3_INPUT_ERROR_RX_PACKET_NO_SOP, 1);
213 prev_b0->
flags |= VLIB_BUFFER_NEXT_PRESENT;
221 VMXNET3_INPUT_ERROR_RX_PACKET, 1);
253 next[0] = next_index;
264 hb->flags |= VNET_BUFFER_F_IS_IP4;
272 hb->flags |= VNET_BUFFER_F_IS_IP6;
298 u32 n_left = n_rx_packets;
302 while (n_trace && n_left)
336 VMXNET3_INPUT_ERROR_BUFFER_ALLOC, 1);
342 VMXNET3_INPUT_ERROR_BUFFER_ALLOC, 1);
361 if ((vd->
flags & VMXNET3_DEVICE_F_ADMIN_UP) == 0)
368 #ifndef CLIB_MARCH_VARIANT 371 .name =
"vmxnet3-input",
372 .sibling_of =
"device-input",
375 .state = VLIB_NODE_STATE_DISABLED,
static_always_inline clib_error_t * vmxnet3_rxq_refill_ring0(vlib_main_t *vm, vmxnet3_device_t *vd, vmxnet3_rxq_t *rxq)
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.
const u32 device_input_next_node_advance[((VNET_DEVICE_INPUT_N_NEXT_NODES/CLIB_CACHE_LINE_BYTES)+1) *CLIB_CACHE_LINE_BYTES]
u32 current_config_index
Used by feature subgraph arcs to visit enabled feature nodes.
vnet_main_t * vnet_get_main(void)
vmxnet3_rx_desc * rx_desc[VMXNET3_RX_RING_SIZE]
vnet_interface_main_t interface_main
static void vlib_error_count(vlib_main_t *vm, uword node_index, uword counter, uword increment)
vmxnet3_main_t vmxnet3_main
#define VLIB_NODE_FN(node)
static void vlib_trace_buffer(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, vlib_buffer_t *b, int follow_chain)
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
#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 vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
#define VMXNET3_RXC_INDEX
#define VMXNET3_RXCL_LEN_MASK
static u32 vlib_get_buffer_index(vlib_main_t *vm, void *p)
Translate buffer pointer into buffer index.
u16 current_length
Nbytes between current data and the end of this buffer.
vmxnet3_rx_comp_ring rx_comp_ring
u32 node_index
Node index.
vlib_error_t error
Error code for buffers to be enqueued to error handler.
#define VLIB_REGISTER_NODE(x,...)
static_always_inline void vlib_buffer_enqueue_to_next(vlib_main_t *vm, vlib_node_runtime_t *node, u32 *buffers, u16 *nexts, uword count)
u32 per_interface_next_index
u32 next_buffer
Next buffer for this linked-list of buffers.
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)
u32 total_length_not_including_first_buffer
Only valid for first buffer in chain.
#define foreach_device_and_queue(var, vec)
#define VMXNET3_RXCL_ERROR
#define VMXNET3_RXF_BTYPE
vmxnet3_rx_comp * rx_comp
vmxnet3_rx_ring rx_ring[VMXNET3_RX_RING_SIZE]
format_function_t format_vmxnet3_input_trace
static_always_inline void vnet_feature_start_device_input_x1(u32 sw_if_index, u32 *next0, vlib_buffer_t *b0)
vmxnet3_device_t * devices
static_always_inline clib_error_t * vmxnet3_rxq_refill_ring1(vlib_main_t *vm, vmxnet3_device_t *vd, vmxnet3_rxq_t *rxq)
static void vlib_buffer_free_one(vlib_main_t *vm, u32 buffer_index)
Free one buffer Shorthand to free a single buffer chain.
static void vlib_set_trace_count(vlib_main_t *vm, vlib_node_runtime_t *rt, u32 count)
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.