|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
20 #include <sys/ioctl.h>
28 #include <vnet/devices/netmap/net_netmap.h>
29 #include <vnet/devices/netmap/netmap.h>
31 #define foreach_netmap_input_error
35 #define _(f,s) NETMAP_INPUT_ERROR_##f,
62 s =
format (s,
"netmap: hw_if_index %d next-index %d",
64 s =
format (s,
"\n%Uslot: flags 0x%x len %u buf_idx %u",
82 prev_b->
flags |= VLIB_BUFFER_NEXT_PRESENT;
119 while (cur_ring <= nif->last_rx_ring && n_free_bufs)
123 ring = NETMAP_RXRING (nif->
nifp, cur_ring);
124 r = nm_ring_space (ring);
135 cur_slot_index = ring->
cur;
142 while (
r && n_left_to_next)
146 u32 bi0 = 0, first_bi0 = 0, prev_bi0;
147 u32 next_slot_index = (cur_slot_index + 1) % ring->
num_slots;
148 u32 next2_slot_index = (cur_slot_index + 2) % ring->
num_slots;
164 u32 last_empty_buffer =
177 (
u8 *) NETMAP_BUF (ring,
slot->buf_idx) +
186 b0->
flags = VLIB_BUFFER_TOTAL_LENGTH_VALID;
222 n_left_to_next, first_bi0,
227 n_rx_bytes +=
slot->len;
228 to_next[0] = first_bi0;
231 cur_slot_index = next_slot_index;
237 ring->
head = ring->
cur = cur_slot_index;
259 u32 n_rx_packets = 0;
268 (
i %
nm->input_cpu_count) ==
278 .name =
"netmap-input",
279 .sibling_of =
"device-input",
284 .state = VLIB_NODE_STATE_INTERRUPT,
u32 next_buffer
Next buffer for this linked-list of buffers.
netmap_main_t netmap_main
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.
nat44_ei_interface_t * interfaces
vlib_main_t vlib_node_runtime_t * node
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static u32 vlib_get_trace_count(vlib_main_t *vm, vlib_node_runtime_t *rt)
@ VNET_DEVICE_INPUT_NEXT_ETHERNET_INPUT
vnet_hw_if_output_node_runtime_t * r
static_always_inline void * clib_memcpy_fast(void *restrict dst, const void *restrict src, size_t n)
#define CLIB_PREFETCH(addr, size, type)
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)
#define VLIB_NODE_FN(node)
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)
static_always_inline uword vlib_get_thread_index(void)
sll srl srl sll sra u16x4 i
#define VLIB_NODE_FLAG_TRACE_SUPPORTED
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
@ 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.
#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
description fragment has unexpected format
vlib_put_next_frame(vm, node, next_index, 0)
u32 per_interface_next_index
static_always_inline u32 vlib_buffer_get_default_data_size(vlib_main_t *vm)
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
static_always_inline void vnet_feature_start_device_input_x1(u32 sw_if_index, u32 *next0, vlib_buffer_t *b0)
struct netmap_slot slot[0]
static void vnet_device_increment_rx_packets(u32 thread_index, u64 count)
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.
#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).
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,...)