FD.io VPP  v18.04-17-g3a0d853
Vector Packet Processing
node.c File Reference
+ Include dependency graph for node.c:

Go to the source code of this file.

Functions

static u32 dpdk_rx_next_from_etype (struct rte_mbuf *mb)
 
static void dpdk_rx_error_from_mb (struct rte_mbuf *mb, u32 *next, u8 *error)
 
static_always_inline void dpdk_add_trace (vlib_main_t *vm, vlib_node_runtime_t *node, u32 next, dpdk_device_t *xd, u16 queue_id, vlib_buffer_t *b, struct rte_mbuf *mb)
 
static u32 dpdk_rx_burst (dpdk_main_t *dm, dpdk_device_t *xd, u16 queue_id)
 
static_always_inline void dpdk_process_subseq_segs (vlib_main_t *vm, vlib_buffer_t *b, struct rte_mbuf *mb, vlib_buffer_free_list_t *fl)
 
static_always_inline void dpdk_prefetch_buffer (struct rte_mbuf *mb)
 
static_always_inline void dpdk_prefetch_ethertype (struct rte_mbuf *mb)
 
static_always_inline u32 dpdk_device_input (dpdk_main_t *dm, dpdk_device_t *xd, vlib_node_runtime_t *node, u32 thread_index, u16 queue_id, int maybe_multiseg, u32 n_trace)
 
static_always_inline u32 dpdk_device_input_mseg (dpdk_main_t *dm, dpdk_device_t *xd, vlib_node_runtime_t *node, u32 thread_index, u16 queue_id, u32 n_trace)
 
static void poll_rate_limit (dpdk_main_t *dm)
 
uword CLIB_MULTIARCH_FN() dpdk_input (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *f)
 Main DPDK input node. More...
 
static void __clib_constructor dpdk_input_multiarch_select (void)
 

Variables

static char * dpdk_error_strings []
 
vlib_node_registration_t dpdk_input_node
 (constructor) VLIB_REGISTER_NODE (dpdk_input_node) More...
 
vlib_node_function_t __clib_weak dpdk_input_avx512
 
vlib_node_function_t __clib_weak dpdk_input_avx2
 

Function Documentation

static_always_inline void dpdk_add_trace ( vlib_main_t vm,
vlib_node_runtime_t node,
u32  next,
dpdk_device_t xd,
u16  queue_id,
vlib_buffer_t b,
struct rte_mbuf *  mb 
)

Definition at line 72 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static_always_inline u32 dpdk_device_input ( dpdk_main_t dm,
dpdk_device_t xd,
vlib_node_runtime_t node,
u32  thread_index,
u16  queue_id,
int  maybe_multiseg,
u32  n_trace 
)

Definition at line 188 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static_always_inline u32 dpdk_device_input_mseg ( dpdk_main_t dm,
dpdk_device_t xd,
vlib_node_runtime_t node,
u32  thread_index,
u16  queue_id,
u32  n_trace 
)

Definition at line 495 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uword CLIB_MULTIARCH_FN() dpdk_input ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t f 
)

Main DPDK input node.

Node Identifier:
dpdk-input

This is the main DPDK input node: across each assigned interface, call rte_eth_rx_burst(...) or similar to obtain a vector of packets to process. Handle early packet discard. Derive vlib_buffer_t metadata from struct rte_mbuf metadata, Depending on the resulting metadata: adjust b->current_data, b->current_length and dispatch directly to ip4-input-no-checksum, or ip6-input. Trace the packet if required.

Parameters
vmvlib_main_t corresponding to the current thread
nodevlib_node_runtime_t
fvlib_frame_t input-node, not used.
Graph mechanics: buffer metadata, next index usage

Uses:

  • struct rte_mbuf mb->ol_flags
    • PKT_RX_IP_CKSUM_BAD
  • RTE_ETH_IS_xxx_HDR(mb->packet_type)
    • packet classification result

Sets:

  • b->error if the packet is to be dropped immediately
  • b->current_data, b->current_length
    • adjusted as needed to skip the L2 header in direct-dispatch cases
  • vnet_buffer(b)->sw_if_index[VLIB_RX]
    • rx interface sw_if_index
  • vnet_buffer(b)->sw_if_index[VLIB_TX] = ~0
    • required by ipX-lookup
  • b->flags
    • to indicate multi-segment pkts (VLIB_BUFFER_NEXT_PRESENT), etc.

Next Nodes:

  • Static arcs to: error-drop, ethernet-input, ip4-input-no-checksum, ip6-input, mpls-input
  • per-interface redirection, controlled by xd->per_interface_next_index

Definition at line 567 of file node.c.

+ Here is the call graph for this function:

static void __clib_constructor dpdk_input_multiarch_select ( void  )
static

Definition at line 630 of file node.c.

static_always_inline void dpdk_prefetch_buffer ( struct rte_mbuf *  mb)

Definition at line 168 of file node.c.

+ Here is the caller graph for this function:

static_always_inline void dpdk_prefetch_ethertype ( struct rte_mbuf *  mb)

Definition at line 176 of file node.c.

+ Here is the caller graph for this function:

static_always_inline void dpdk_process_subseq_segs ( vlib_main_t vm,
vlib_buffer_t b,
struct rte_mbuf *  mb,
vlib_buffer_free_list_t fl 
)

Definition at line 123 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 dpdk_rx_burst ( dpdk_main_t dm,
dpdk_device_t xd,
u16  queue_id 
)
inlinestatic

Definition at line 90 of file node.c.

+ Here is the caller graph for this function:

static void dpdk_rx_error_from_mb ( struct rte_mbuf *  mb,
u32 next,
u8 error 
)
inlinestatic

Definition at line 60 of file node.c.

+ Here is the caller graph for this function:

static u32 dpdk_rx_next_from_etype ( struct rte_mbuf *  mb)
inlinestatic

Definition at line 40 of file node.c.

+ Here is the caller graph for this function:

static void poll_rate_limit ( dpdk_main_t dm)
inlinestatic

Definition at line 508 of file node.c.

+ Here is the caller graph for this function:

Variable Documentation

char* dpdk_error_strings[]
static
Initial value:
= {
#define _(n,s)
}
#define foreach_dpdk_error
Definition: dpdk.h:432

Definition at line 32 of file node.c.

vlib_node_function_t __clib_weak dpdk_input_avx2

Definition at line 626 of file node.c.

vlib_node_function_t __clib_weak dpdk_input_avx512

Definition at line 625 of file node.c.

vlib_node_registration_t dpdk_input_node
Initial value:
= {
.function = dpdk_input,
.name = "dpdk-input",
.sibling_of = "device-input",
.state = VLIB_NODE_STATE_DISABLED,
.format_trace = format_dpdk_rx_dma_trace,
.n_errors = DPDK_N_ERROR,
.error_strings = dpdk_error_strings,
}
format_function_t format_dpdk_rx_dma_trace
Definition: dpdk.h:455
static char * dpdk_error_strings[]
Definition: node.c:32
u8 * format_ethernet_header_with_length(u8 *s, va_list *args)
Definition: format.c:91
uword CLIB_MULTIARCH_FN() dpdk_input(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *f)
Main DPDK input node.
Definition: node.c:567

(constructor) VLIB_REGISTER_NODE (dpdk_input_node)

Definition at line 608 of file node.c.