FD.io VPP  v16.09
Vector Packet Processing
node.c File Reference
+ Include dependency graph for node.c:

Go to the source code of this file.

Macros

#define MAX(a, b)   ((a) < (b) ? (b) : (a))
 
#define MIN(a, b)   ((a) < (b) ? (a) : (b))
 
#define VMWARE_LENGTH_BUG_WORKAROUND   0
 

Functions

static int dpdk_mbuf_is_ip4 (struct rte_mbuf *mb)
 
static int dpdk_mbuf_is_ip6 (struct rte_mbuf *mb)
 
static int vlib_buffer_is_mpls (vlib_buffer_t *b)
 
static void dpdk_rx_next_and_error_from_mb_flags_x1 (dpdk_device_t *xd, struct rte_mbuf *mb, vlib_buffer_t *b0, u8 *next0, u8 *error0)
 
void dpdk_rx_trace (dpdk_main_t *dm, vlib_node_runtime_t *node, dpdk_device_t *xd, u16 queue_id, u32 *buffers, uword n_buffers)
 
void dpdk_efd_update_counters (dpdk_device_t *xd, u32 n_buffers, u16 enabled)
 
u32 is_efd_discardable (vlib_thread_main_t *tm, vlib_buffer_t *b0, struct rte_mbuf *mb)
 
static u32 dpdk_rx_burst (dpdk_main_t *dm, dpdk_device_t *xd, u16 queue_id)
 
static u32 dpdk_device_input (dpdk_main_t *dm, dpdk_device_t *xd, vlib_node_runtime_t *node, u32 cpu_index, u16 queue_id, int use_efd)
 
static void poll_rate_limit (dpdk_main_t *dm)
 
static uword dpdk_input (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *f)
 Main DPDK input node. More...
 
uword dpdk_input_rss (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *f)
 
uword dpdk_input_efd (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *f)
 
 CLIB_MULTIARCH_SELECT_FN (dpdk_input)
 
 CLIB_MULTIARCH_SELECT_FN (dpdk_input_rss)
 
 CLIB_MULTIARCH_SELECT_FN (dpdk_input_efd)
 
void dpdk_set_next_node (dpdk_rx_next_t next, char *name)
 
void set_efd_bitmap (u8 *bitmap, u32 value, u32 op)
 
void efd_config (u32 enabled, u32 ip_prec, u32 ip_op, u32 mpls_exp, u32 mpls_op, u32 vlan_cos, u32 vlan_op)
 

Variables

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

Macro Definition Documentation

#define MAX (   a,
 
)    ((a) < (b) ? (b) : (a))

Definition at line 30 of file node.c.

#define MIN (   a,
 
)    ((a) < (b) ? (a) : (b))

Definition at line 34 of file node.c.

#define VMWARE_LENGTH_BUG_WORKAROUND   0

Definition at line 50 of file node.c.

Function Documentation

CLIB_MULTIARCH_SELECT_FN ( dpdk_input  )
CLIB_MULTIARCH_SELECT_FN ( dpdk_input_rss  )
CLIB_MULTIARCH_SELECT_FN ( dpdk_input_efd  )
static u32 dpdk_device_input ( dpdk_main_t dm,
dpdk_device_t xd,
vlib_node_runtime_t node,
u32  cpu_index,
u16  queue_id,
int  use_efd 
)
inlinestatic

Definition at line 390 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void dpdk_efd_update_counters ( dpdk_device_t xd,
u32  n_buffers,
u16  enabled 
)

Definition at line 197 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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_EXT_RX_PKT_ERROR, PKT_EXT_RX_BAD_FCS PKT_RX_IP_CKSUM_BAD, PKT_RX_L4_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-gre-input
  • per-interface redirection, controlled by xd->per_interface_next_index

Definition at line 709 of file node.c.

+ Here is the call graph for this function:

uword dpdk_input_efd ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t f 
)

Definition at line 761 of file node.c.

+ Here is the call graph for this function:

uword dpdk_input_rss ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t f 
)

Definition at line 735 of file node.c.

+ Here is the call graph for this function:

static int dpdk_mbuf_is_ip4 ( struct rte_mbuf *  mb)
inlinestatic

Definition at line 59 of file node.c.

+ Here is the caller graph for this function:

static int dpdk_mbuf_is_ip6 ( struct rte_mbuf *  mb)
inlinestatic

Definition at line 65 of file node.c.

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void dpdk_rx_next_and_error_from_mb_flags_x1 ( dpdk_device_t xd,
struct rte_mbuf *  mb,
vlib_buffer_t b0,
u8 next0,
u8 error0 
)
inlinestatic

Definition at line 78 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void dpdk_rx_trace ( dpdk_main_t dm,
vlib_node_runtime_t node,
dpdk_device_t xd,
u16  queue_id,
u32 buffers,
uword  n_buffers 
)

Definition at line 142 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void dpdk_set_next_node ( dpdk_rx_next_t  next,
char *  name 
)

Definition at line 828 of file node.c.

+ Here is the caller graph for this function:

void efd_config ( u32  enabled,
u32  ip_prec,
u32  ip_op,
u32  mpls_exp,
u32  mpls_op,
u32  vlan_cos,
u32  vlan_op 
)

Definition at line 870 of file node.c.

+ Here is the call graph for this function:

u32 is_efd_discardable ( vlib_thread_main_t tm,
vlib_buffer_t b0,
struct rte_mbuf *  mb 
)

Definition at line 233 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 649 of file node.c.

+ Here is the caller graph for this function:

void set_efd_bitmap ( u8 bitmap,
u32  value,
u32  op 
)

Definition at line 854 of file node.c.

+ Here is the caller graph for this function:

static int vlib_buffer_is_mpls ( vlib_buffer_t b)
inlinestatic

Definition at line 71 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:498

Definition at line 52 of file node.c.

vlib_node_registration_t dpdk_input_node
Initial value:
= {
.function = dpdk_input,
.name = "dpdk-input",
.state = VLIB_NODE_STATE_DISABLED,
.format_trace = format_dpdk_rx_dma_trace,
.n_errors = DPDK_N_ERROR,
.error_strings = dpdk_error_strings,
.n_next_nodes = DPDK_RX_N_NEXT,
.next_nodes = {
[DPDK_RX_NEXT_DROP] = "error-drop",
[DPDK_RX_NEXT_ETHERNET_INPUT] = "ethernet-input",
[DPDK_RX_NEXT_IP4_INPUT] = "ip4-input-no-checksum",
[DPDK_RX_NEXT_IP6_INPUT] = "ip6-input",
[DPDK_RX_NEXT_MPLS_INPUT] = "mpls-gre-input",
},
}
static char * dpdk_error_strings[]
Definition: node.c:52
format_function_t format_dpdk_rx_dma_trace
Definition: dpdk.h:623
u8 * format_ethernet_header_with_length(u8 *s, va_list *args)
Definition: format.c:91
static uword dpdk_input(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *f)
Main DPDK input node.
Definition: node.c:709

(constructor) VLIB_REGISTER_NODE (dpdk_input_node)

Definition at line 787 of file node.c.