FD.io VPP  v18.07.1-19-g511ce25
Vector Packet Processing
node.c File Reference
+ Include dependency graph for node.c:

Go to the source code of this file.

Enumerations

enum  { DPDK_RX_F_CKSUM_GOOD = 7, DPDK_RX_F_CKSUM_BAD = 4, DPDK_RX_F_FDIR = 2 }
 

Functions

 STATIC_ASSERT (VNET_DEVICE_INPUT_NEXT_IP4_INPUT-1==VNET_DEVICE_INPUT_NEXT_IP4_NCS_INPUT,"IP4_INPUT must follow IP4_NCS_INPUT")
 
 STATIC_ASSERT (1<< DPDK_RX_F_CKSUM_GOOD==PKT_RX_IP_CKSUM_GOOD,"")
 
 STATIC_ASSERT ((PKT_RX_IP_CKSUM_GOOD|PKT_RX_IP_CKSUM_BAD|PKT_RX_FDIR)< 256,"dpdk flags not un lower byte, fix needed")
 
static u32 dpdk_rx_next (vlib_node_runtime_t *node, u16 etype, u8 flags)
 
static_always_inline uword 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_mbuf_x4 (struct rte_mbuf *mb[])
 
static_always_inline void dpdk_prefetch_buffer_x4 (struct rte_mbuf *mb[])
 
static_always_inline void dpdk_prefetch_buffer_data_x4 (struct rte_mbuf *mb[])
 
static_always_inline u8 dpdk_ol_flags_extract (struct rte_mbuf **mb, u8 *flags, int count)
 Main DPDK input node. More...
 
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, u8 *or_flagsp)
 
static_always_inline void dpdk_set_next_from_etype (vlib_main_t *vm, vlib_node_runtime_t *node, dpdk_per_thread_data_t *ptd, uword n_rx_packets)
 
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 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)
 
VLIB_NODE_FN() dpdk_input_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *f)
 

Variables

static char * dpdk_error_strings []
 
vlib_node_registration_t dpdk_input_node
 (constructor) VLIB_REGISTER_NODE (dpdk_input_node) More...
 

Enumeration Type Documentation

anonymous enum
Enumerator
DPDK_RX_F_CKSUM_GOOD 
DPDK_RX_F_CKSUM_BAD 
DPDK_RX_F_FDIR 

Definition at line 43 of file node.c.

Function Documentation

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 
)

Definition at line 435 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

VLIB_NODE_FN() dpdk_input_node ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t f 
)

Definition at line 621 of file node.c.

+ Here is the call graph for this function:

static_always_inline u8 dpdk_ol_flags_extract ( struct rte_mbuf **  mb,
u8 flags,
int  count 
)

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. 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

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 199 of file node.c.

+ Here is the caller graph for this function:

static_always_inline void dpdk_prefetch_buffer_data_x4 ( struct rte_mbuf *  mb[])

Definition at line 146 of file node.c.

+ Here is the caller graph for this function:

static_always_inline void dpdk_prefetch_buffer_x4 ( struct rte_mbuf *  mb[])

Definition at line 132 of file node.c.

+ Here is the caller graph for this function:

static_always_inline void dpdk_prefetch_mbuf_x4 ( struct rte_mbuf *  mb[])

Definition at line 123 of file node.c.

+ Here is the caller graph for this function:

static_always_inline void dpdk_process_flow_offload ( dpdk_device_t xd,
dpdk_per_thread_data_t ptd,
uword  n_rx_packets 
)

Definition at line 401 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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,
u8 or_flagsp 
)

Definition at line 214 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static_always_inline uword 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 77 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 dpdk_rx_next ( vlib_node_runtime_t node,
u16  etype,
u8  flags 
)
inlinestatic

Definition at line 60 of file node.c.

+ Here is the caller graph for this function:

static_always_inline void dpdk_set_next_from_etype ( vlib_main_t vm,
vlib_node_runtime_t node,
dpdk_per_thread_data_t ptd,
uword  n_rx_packets 
)

Definition at line 335 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

STATIC_ASSERT ( VNET_DEVICE_INPUT_NEXT_IP4_INPUT 1 = =VNET_DEVICE_INPUT_NEXT_IP4_NCS_INPUT,
"IP4_INPUT must follow IP4_NCS_INPUT"   
)
STATIC_ASSERT ( 1<<  DPDK_RX_F_CKSUM_GOOD = =PKT_RX_IP_CKSUM_GOOD,
""   
)
STATIC_ASSERT ( )

Variable Documentation

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

Definition at line 32 of file node.c.

vlib_node_registration_t dpdk_input_node
Initial value:
= {
.name = "dpdk-input",
.sibling_of = "device-input",
.state = VLIB_NODE_STATE_DISABLED,
.format_trace = format_dpdk_rx_trace,
.n_errors = DPDK_N_ERROR,
.error_strings = dpdk_error_strings,
}
static char * dpdk_error_strings[]
Definition: node.c:32
u8 * format_ethernet_header_with_length(u8 *s, va_list *args)
Definition: format.c:91
format_function_t format_dpdk_rx_trace
Definition: dpdk.h:515

(constructor) VLIB_REGISTER_NODE (dpdk_input_node)

Definition at line 649 of file node.c.