40 256,
"dpdk flags not un lower byte, fix needed");
47 struct rte_mbuf *mb_seg = 0;
55 b->
flags |= VLIB_BUFFER_TOTAL_LENGTH_VALID;
58 while (nb_seg < mb->nb_segs)
70 (mb_seg->buf_addr + mb_seg->data_off) - (
void *) b_seg->
data;
75 b_chain->
flags |= VLIB_BUFFER_NEXT_PRESENT;
79 mb_seg = mb_seg->next;
152 for (i = 0; i <
count; i++)
156 flags[
i] = (
u16) mb[i]->ol_flags;
164 uword n_rx_packets,
int maybe_multiseg,
167 u32 n_left = n_rx_packets;
169 struct rte_mbuf **mb = ptd->
mbufs;
198 b[0]->
current_data = mb[0]->data_off - RTE_PKTMBUF_HEADROOM;
201 b[1]->
current_data = mb[1]->data_off - RTE_PKTMBUF_HEADROOM;
204 b[2]->
current_data = mb[2]->data_off - RTE_PKTMBUF_HEADROOM;
207 b[3]->
current_data = mb[3]->data_off - RTE_PKTMBUF_HEADROOM;
235 b[0]->
current_data = mb[0]->data_off - RTE_PKTMBUF_HEADROOM;
247 *or_flagsp = or_flags;
260 for (n = 0; n < n_rx_packets; n++)
262 if ((ptd->
flags[n] & PKT_RX_FDIR_ID) == 0)
266 ptd->
mbufs[n]->hash.fdir.hi);
289 uword n_rx_packets = 0, n_rx_bytes;
294 struct rte_mbuf **mb;
305 if ((xd->
flags & DPDK_DEVICE_FLAG_ADMIN_UP) == 0)
311 n = rte_eth_rx_burst (xd->
port_id, queue_id,
312 ptd->
mbufs + n_rx_packets,
320 if (n_rx_packets == 0)
342 if (xd->
flags & DPDK_DEVICE_FLAG_MAYBE_MULTISEG)
350 for (n = 0; n < n_rx_packets; n++)
351 ptd->
next[n] = next_index;
356 (or_flags & PKT_RX_FDIR)))
362 sizeof (
struct rte_mbuf));
369 u32 *to_next, n_left_to_next;
374 sizeof (
struct rte_mbuf));
392 if (xd->
flags & DPDK_DEVICE_FLAG_RX_IP4_CKSUM &&
393 (or_flags & PKT_RX_IP_CKSUM_BAD) == 0)
397 n_left_to_next -= n_rx_packets;
408 sizeof (
struct rte_mbuf));
410 n_left = n_rx_packets;
415 while (n_trace && n_left)
418 if (single_next == 0)
419 next_index = next[0];
423 (vm, node, next_index, b0, 0)))
434 sizeof b0[0] -
sizeof b0->
pre_data);
453 n_rx_packets, n_rx_bytes);
465 uword n_rx_packets = 0;
487 .name =
"dpdk-input",
488 .sibling_of =
"device-input",
492 .state = VLIB_NODE_STATE_DISABLED,
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 void vnet_device_increment_rx_packets(u32 thread_index, u64 count)
static_always_inline void dpdk_process_flow_offload(dpdk_device_t *xd, dpdk_per_thread_data_t *ptd, uword n_rx_packets)
static_always_inline void dpdk_prefetch_mbuf_x4(struct rte_mbuf *mb[])
#define vlib_buffer_from_rte_mbuf(x)
static u32 vlib_get_trace_count(vlib_main_t *vm, vlib_node_runtime_t *rt)
vl_api_wireguard_peer_flags_t flags
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.
vnet_main_t * vnet_get_main(void)
vlib_node_registration_t dpdk_input_node
(constructor) VLIB_REGISTER_NODE (dpdk_input_node)
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
static_always_inline void dpdk_prefetch_buffer_x4(struct rte_mbuf *mb[])
#define foreach_dpdk_error
#define clib_memcpy_fast(a, b, c)
#define VLIB_NODE_FLAG_TRACE_SUPPORTED
u16 current_length
Nbytes between current data and the end of this buffer.
static vlib_frame_t * vlib_get_frame(vlib_main_t *vm, vlib_frame_t *f)
u32 per_interface_next_index
#define VLIB_NODE_FN(node)
vlib_error_t * errors
Vector of errors for this node.
static_always_inline uword dpdk_process_rx_burst(vlib_main_t *vm, dpdk_per_thread_data_t *ptd, uword n_rx_packets, int maybe_multiseg, u16 *or_flagsp)
u8 buffer_pool_index
index of buffer pool this buffer belongs.
#define static_always_inline
#define ETH_INPUT_FRAME_F_SINGLE_SW_IF_IDX
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 vlib_get_new_next_frame(vm, node, next_index, vectors, n_vectors_left)
static char * dpdk_error_strings[]
static vlib_next_frame_t * vlib_node_runtime_get_next_frame(vlib_main_t *vm, vlib_node_runtime_t *n, u32 next_index)
static u32 vlib_get_buffer_index(vlib_main_t *vm, void *p)
Translate buffer pointer into buffer index.
vlib_error_t error
Error code for buffers to be enqueued to error handler.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static_always_inline u16 dpdk_ol_flags_extract(struct rte_mbuf **mb, u16 *flags, int count)
Main DPDK input node.
dpdk_per_thread_data_t * per_thread_data
static_always_inline void vlib_buffer_copy_template(vlib_buffer_t *b, vlib_buffer_t *bt)
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)
#define ETH_INPUT_FRAME_F_IP4_CKSUM_OK
vlib_buffer_t buffer_template
STATIC_ASSERT(STRUCT_OFFSET_OF(vnet_buffer_opaque_t, l2_hdr_offset)==STRUCT_OFFSET_OF(vnet_buffer_opaque_t, l3_hdr_offset) - 2, "l3_hdr_offset must follow l2_hdr_offset")
static_always_inline void vlib_get_buffer_indices_with_offset(vlib_main_t *vm, void **b, u32 *bi, uword count, i32 offset)
Translate array of buffer pointers into buffer indices with offset.
u8 * format_ethernet_header_with_length(u8 *s, va_list *args)
#define VLIB_REGISTER_NODE(x,...)
u16 flags[DPDK_RX_BURST_SZ]
#define CLIB_PREFETCH(addr, size, type)
dpdk_flow_lookup_entry_t * flow_lookup_entries
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 flow_id
Generic flow identifier.
sll srl srl sll sra u16x4 i
static void * vlib_frame_scalar_args(vlib_frame_t *f)
Get pointer to frame scalar data.
u32 current_config_index
Used by feature subgraph arcs to visit enabled feature nodes.
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.
vlib_main_t vlib_node_runtime_t * node
u32 buffers[DPDK_RX_BURST_SZ]
static_always_inline u32 dpdk_device_input(vlib_main_t *vm, dpdk_main_t *dm, dpdk_device_t *xd, vlib_node_runtime_t *node, u32 thread_index, u16 queue_id)
u8 pre_data[VLIB_BUFFER_PRE_DATA_SIZE]
Space for inserting data before buffer start.
u16 next[DPDK_RX_BURST_SZ]
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
format_function_t format_dpdk_rx_trace
struct rte_mbuf * mbufs[DPDK_RX_BURST_SZ]
#define foreach_device_and_queue(var, vec)
u32 next_buffer
Next buffer for this linked-list of buffers.
#define VLIB_BUFFER_TRACE_TRAJECTORY_INIT(b)
VLIB buffer representation.
static_always_inline void vnet_feature_start_device_input_x1(u32 sw_if_index, u32 *next0, vlib_buffer_t *b0)
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
dpdk_rx_queue_t * rx_queues
static void vlib_frame_no_append(vlib_frame_t *f)
static void vlib_set_trace_count(vlib_main_t *vm, vlib_node_runtime_t *rt, u32 count)
#define CLIB_CACHE_LINE_BYTES
u32 total_length_not_including_first_buffer
Only valid for first buffer in chain.
static_always_inline uword dpdk_process_subseq_segs(vlib_main_t *vm, vlib_buffer_t *b, struct rte_mbuf *mb, vlib_buffer_t *bt)
volatile u8 ref_count
Reference count for this buffer.
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
CLIB vectors are ubiquitous dynamically resized arrays with by user defined "headers".