FD.io VPP  v16.12-rc0-308-g931be3a
Vector Packet Processing
dpdk.h File Reference
+ Include dependency graph for dpdk.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  dpdk_frame_t
 
struct  dpdk_efd_agent_t
 
struct  tx_ring_hdr_t
 
struct  dpdk_device_hqos_per_worker_thread_t
 
struct  dpdk_device_hqos_per_hqos_thread_t
 
struct  dpdk_device_t
 
struct  dpdk_worker_t
 
struct  dpdk_hqos_thread_t
 
struct  dpdk_device_and_queue_t
 
struct  dpdk_efd_t
 
struct  dpdk_device_config_hqos_t
 
struct  dpdk_device_config_t
 
struct  dpdk_config_main_t
 
struct  dpdk_main_t
 
struct  dpdk_tx_dma_trace_t
 
struct  dpdk_rx_dma_trace_t
 

Macros

#define always_inline   static inline
 
#define NB_MBUF   (16<<10)
 
#define foreach_dpdk_pmd
 
#define DPDK_EFD_MAX_DISCARD_RATE   10
 
#define DPDK_DEVICE_FLAG_ADMIN_UP   (1 << 0)
 
#define DPDK_DEVICE_FLAG_PROMISC   (1 << 1)
 
#define DPDK_DEVICE_FLAG_PMD   (1 << 2)
 
#define DPDK_DEVICE_FLAG_HAVE_SUBIF   (1 << 5)
 
#define DPDK_DEVICE_FLAG_HQOS   (1 << 6)
 
#define DPDK_STATS_POLL_INTERVAL   (10.0)
 
#define DPDK_MIN_STATS_POLL_INTERVAL   (0.001) /* 1msec */
 
#define DPDK_LINK_POLL_INTERVAL   (3.0)
 
#define DPDK_MIN_LINK_POLL_INTERVAL   (0.001) /* 1msec */
 
#define DPDK_EFD_DISABLED   0
 
#define DPDK_EFD_DISCARD_ENABLED   (1 << 0)
 
#define DPDK_EFD_MONITOR_ENABLED   (1 << 1)
 
#define DPDK_EFD_DROPALL_ENABLED   (1 << 2)
 
#define DPDK_EFD_DEFAULT_DEVICE_QUEUE_HI_THRESH_PCT   90
 
#define DPDK_EFD_DEFAULT_CONSEC_FULL_FRAMES_HI_THRESH   6
 
#define DPDK_HQOS_DBG_BYPASS   0
 
#define HQOS_FLUSH_COUNT_THRESHOLD   100000
 
#define foreach_dpdk_device_config_item
 
#define DPDK_DEVICE_VLAN_STRIP_DEFAULT   0
 
#define DPDK_DEVICE_VLAN_STRIP_OFF   1
 
#define DPDK_DEVICE_VLAN_STRIP_ON   2
 
#define foreach_dpdk_error
 
#define EFD_OPERATION_LESS_THAN   0
 
#define EFD_OPERATION_GREATER_OR_EQUAL   1
 

Typedefs

typedef void(* dpdk_flowcontrol_callback_t) (vlib_main_t *vm, u32 hw_if_index, u32 n_packets)
 
typedef struct dpdk_efd_t dpdk_efd_t
 
typedef struct dpdk_device_config_hqos_t dpdk_device_config_hqos_t
 

Enumerations

enum  dpdk_pmd_t { VNET_DPDK_PMD_NONE, VNET_DPDK_PMD_UNKNOWN }
 
enum  dpdk_port_type_t {
  VNET_DPDK_PORT_TYPE_ETH_1G, VNET_DPDK_PORT_TYPE_ETH_10G, VNET_DPDK_PORT_TYPE_ETH_40G, VNET_DPDK_PORT_TYPE_ETH_BOND,
  VNET_DPDK_PORT_TYPE_ETH_SWITCH, VNET_DPDK_PORT_TYPE_AF_PACKET, VNET_DPDK_PORT_TYPE_UNKNOWN
}
 
enum  dpdk_error_t { DPDK_N_ERROR }
 

Functions

int dpdk_hqos_validate_mask (u64 mask, u32 n)
 
void dpdk_device_config_hqos_pipe_profile_default (dpdk_device_config_hqos_t *hqos, u32 pipe_profile_id)
 
void dpdk_device_config_hqos_default (dpdk_device_config_hqos_t *hqos)
 
clib_error_tdpdk_port_setup_hqos (dpdk_device_t *xd, dpdk_device_config_hqos_t *hqos)
 
void dpdk_hqos_metadata_set (dpdk_device_hqos_per_worker_thread_t *hqos, struct rte_mbuf **pkts, u32 n_pkts)
 
void vnet_buffer_needs_dpdk_mb (vlib_buffer_t *b)
 
clib_error_tdpdk_set_mac_address (vnet_hw_interface_t *hi, char *address)
 
clib_error_tdpdk_set_mc_filter (vnet_hw_interface_t *hi, struct ether_addr mc_addr_vec[], int naddr)
 
void dpdk_thread_input (dpdk_main_t *dm, dpdk_device_t *xd)
 
clib_error_tdpdk_port_setup (dpdk_main_t *dm, dpdk_device_t *xd)
 
void dpdk_set_flowcontrol_callback (vlib_main_t *vm, dpdk_flowcontrol_callback_t callback)
 
u32 dpdk_interface_tx_vector (vlib_main_t *vm, u32 dev_instance)
 
void set_efd_bitmap (u8 *bitmap, u32 value, u32 op)
 
struct rte_mbuf * dpdk_replicate_packet_mb (vlib_buffer_t *b)
 
struct rte_mbuf * dpdk_zerocopy_replicate_packet_mb (vlib_buffer_t *b)
 
static_always_inline void increment_efd_drop_counter (vlib_main_t *vm, u32 counter_index, u32 count)
 
int dpdk_set_stat_poll_interval (f64 interval)
 
int dpdk_set_link_state_poll_interval (f64 interval)
 
void dpdk_update_link_state (dpdk_device_t *xd, f64 now)
 
void dpdk_device_lock_init (dpdk_device_t *xd)
 
void dpdk_device_lock_free (dpdk_device_t *xd)
 
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 u64 vnet_get_aggregate_rx_packets (void)
 
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 efd_config (u32 enabled, u32 ip_prec, u32 ip_op, u32 mpls_exp, u32 mpls_op, u32 vlan_cos, u32 vlan_op)
 
void post_sw_interface_set_flags (vlib_main_t *vm, u32 sw_if_index, u32 flags)
 
u32 dpdk_get_admin_up_down_in_progress (void)
 
u32 dpdk_num_mbufs (void)
 
dpdk_pmd_t dpdk_get_pmd_type (vnet_hw_interface_t *hi)
 
i8 dpdk_get_cpu_socket (vnet_hw_interface_t *hi)
 
void * dpdk_input_multiarch_select ()
 
void * dpdk_input_rss_multiarch_select ()
 
void * dpdk_input_efd_multiarch_select ()
 
clib_error_tdpdk_get_hw_interface_stats (u32 hw_if_index, struct rte_eth_stats *dest)
 
clib_error_tunformat_rss_fn (unformat_input_t *input, uword *rss_fn)
 
clib_error_tunformat_hqos (unformat_input_t *input, dpdk_device_config_hqos_t *hqos)
 
uword admin_up_down_process (vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
 

Variables

vnet_device_class_t dpdk_device_class
 
vlib_node_registration_t dpdk_input_node
 (constructor) VLIB_REGISTER_NODE (dpdk_input_node) More...
 
vlib_node_registration_t handoff_dispatch_node
 (constructor) VLIB_REGISTER_NODE (handoff_dispatch_node) More...
 
dpdk_config_main_t dpdk_config_main
 
dpdk_main_t dpdk_main
 
format_function_t format_dpdk_device_name
 
format_function_t format_dpdk_device
 
format_function_t format_dpdk_tx_dma_trace
 
format_function_t format_dpdk_rx_dma_trace
 
format_function_t format_dpdk_rte_mbuf
 
format_function_t format_dpdk_rx_rte_mbuf
 
unformat_function_t unformat_socket_mem
 

Macro Definition Documentation

#define always_inline   static inline

Definition at line 56 of file dpdk.h.

#define DPDK_DEVICE_FLAG_ADMIN_UP   (1 << 0)

Definition at line 216 of file dpdk.h.

#define DPDK_DEVICE_FLAG_HAVE_SUBIF   (1 << 5)

Definition at line 220 of file dpdk.h.

#define DPDK_DEVICE_FLAG_HQOS   (1 << 6)

Definition at line 221 of file dpdk.h.

#define DPDK_DEVICE_FLAG_PMD   (1 << 2)

Definition at line 218 of file dpdk.h.

#define DPDK_DEVICE_FLAG_PROMISC   (1 << 1)

Definition at line 217 of file dpdk.h.

#define DPDK_DEVICE_VLAN_STRIP_DEFAULT   0

Definition at line 357 of file dpdk.h.

#define DPDK_DEVICE_VLAN_STRIP_OFF   1

Definition at line 358 of file dpdk.h.

#define DPDK_DEVICE_VLAN_STRIP_ON   2

Definition at line 359 of file dpdk.h.

#define DPDK_EFD_DEFAULT_CONSEC_FULL_FRAMES_HI_THRESH   6

Definition at line 295 of file dpdk.h.

#define DPDK_EFD_DEFAULT_DEVICE_QUEUE_HI_THRESH_PCT   90

Definition at line 294 of file dpdk.h.

#define DPDK_EFD_DISABLED   0

Definition at line 289 of file dpdk.h.

#define DPDK_EFD_DISCARD_ENABLED   (1 << 0)

Definition at line 290 of file dpdk.h.

#define DPDK_EFD_DROPALL_ENABLED   (1 << 2)

Definition at line 292 of file dpdk.h.

#define DPDK_EFD_MAX_DISCARD_RATE   10

Definition at line 133 of file dpdk.h.

#define DPDK_EFD_MONITOR_ENABLED   (1 << 1)

Definition at line 291 of file dpdk.h.

#define DPDK_HQOS_DBG_BYPASS   0

Definition at line 306 of file dpdk.h.

#define DPDK_LINK_POLL_INTERVAL   (3.0)

Definition at line 263 of file dpdk.h.

#define DPDK_MIN_LINK_POLL_INTERVAL   (0.001) /* 1msec */

Definition at line 264 of file dpdk.h.

#define DPDK_MIN_STATS_POLL_INTERVAL   (0.001) /* 1msec */

Definition at line 261 of file dpdk.h.

#define DPDK_STATS_POLL_INTERVAL   (10.0)

Definition at line 260 of file dpdk.h.

#define EFD_OPERATION_GREATER_OR_EQUAL   1

Definition at line 581 of file dpdk.h.

#define EFD_OPERATION_LESS_THAN   0

Definition at line 580 of file dpdk.h.

#define foreach_dpdk_device_config_item
Value:
_ (num_rx_queues) \
_ (num_tx_queues) \
_ (num_rx_desc) \
_ (num_tx_desc) \
_ (rss_fn)

Definition at line 345 of file dpdk.h.

#define foreach_dpdk_error
Value:
_(NONE, "no error") \
_(RX_PACKET_ERROR, "Rx packet errors") \
_(RX_BAD_FCS, "Rx bad fcs") \
_(L4_CHECKSUM_ERROR, "Rx L4 checksum errors") \
_(IP_CHECKSUM_ERROR, "Rx ip checksum errors") \
_(RX_ALLOC_FAIL, "rx buf alloc from free list failed") \
_(RX_ALLOC_NO_PHYSMEM, "rx buf alloc failed no physmem") \
_(RX_ALLOC_DROP_PKTS, "rx packets dropped due to alloc error") \
_(IPV4_EFD_DROP_PKTS, "IPV4 Early Fast Discard rx drops") \
_(IPV6_EFD_DROP_PKTS, "IPV6 Early Fast Discard rx drops") \
_(MPLS_EFD_DROP_PKTS, "MPLS Early Fast Discard rx drops") \
_(VLAN_EFD_DROP_PKTS, "VLAN Early Fast Discard rx drops")

Definition at line 519 of file dpdk.h.

#define foreach_dpdk_pmd
Value:
_ ("net_thunderx", THUNDERX) \
_ ("net_e1000_em", E1000EM) \
_ ("net_e1000_igb", IGB) \
_ ("net_e1000_igb_vf", IGBVF) \
_ ("net_ixgbe", IXGBE) \
_ ("net_ixgbe_vf", IXGBEVF) \
_ ("net_i40e", I40E) \
_ ("net_i40e_vf", I40EVF) \
_ ("net_virtio", VIRTIO) \
_ ("net_enic", ENIC) \
_ ("net_vmxnet3", VMXNET3) \
_ ("net_af_packet", AF_PACKET) \
_ ("net_bonding", BOND) \
_ ("net_fm10k", FM10K) \
_ ("net_cxgbe", CXGBE) \
_ ("net_dpaa2", DPAA2)

Definition at line 70 of file dpdk.h.

#define HQOS_FLUSH_COUNT_THRESHOLD   100000

Definition at line 310 of file dpdk.h.

#define NB_MBUF   (16<<10)

Definition at line 63 of file dpdk.h.

Typedef Documentation

typedef struct dpdk_efd_t dpdk_efd_t
typedef void(* dpdk_flowcontrol_callback_t) (vlib_main_t *vm, u32 hw_if_index, u32 n_packets)

Definition at line 148 of file dpdk.h.

Enumeration Type Documentation

Enumerator
DPDK_N_ERROR 

Definition at line 533 of file dpdk.h.

enum dpdk_pmd_t
Enumerator
VNET_DPDK_PMD_NONE 
VNET_DPDK_PMD_UNKNOWN 

Definition at line 107 of file dpdk.h.

Enumerator
VNET_DPDK_PORT_TYPE_ETH_1G 
VNET_DPDK_PORT_TYPE_ETH_10G 
VNET_DPDK_PORT_TYPE_ETH_40G 
VNET_DPDK_PORT_TYPE_ETH_BOND 
VNET_DPDK_PORT_TYPE_ETH_SWITCH 
VNET_DPDK_PORT_TYPE_AF_PACKET 
VNET_DPDK_PORT_TYPE_UNKNOWN 

Definition at line 116 of file dpdk.h.

Function Documentation

uword admin_up_down_process ( vlib_main_t vm,
vlib_node_runtime_t rt,
vlib_frame_t f 
)

Definition at line 1001 of file device.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void dpdk_device_config_hqos_default ( dpdk_device_config_hqos_t hqos)

Definition at line 208 of file hqos.c.

+ Here is the caller graph for this function:

void dpdk_device_config_hqos_pipe_profile_default ( dpdk_device_config_hqos_t hqos,
u32  pipe_profile_id 
)

Definition at line 200 of file hqos.c.

void dpdk_device_lock_free ( dpdk_device_t xd)

Definition at line 227 of file init.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void dpdk_device_lock_init ( dpdk_device_t xd)

Definition at line 214 of file init.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 200 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 dpdk_get_admin_up_down_in_progress ( void  )

Definition at line 995 of file device.c.

+ Here is the caller graph for this function:

i8 dpdk_get_cpu_socket ( vnet_hw_interface_t hi)

Definition at line 1131 of file device.c.

clib_error_t* dpdk_get_hw_interface_stats ( u32  hw_if_index,
struct rte_eth_stats *  dest 
)

Definition at line 1075 of file device.c.

+ Here is the call graph for this function:

dpdk_pmd_t dpdk_get_pmd_type ( vnet_hw_interface_t hi)

Definition at line 1113 of file device.c.

void dpdk_hqos_metadata_set ( dpdk_device_hqos_per_worker_thread_t hqos,
struct rte_mbuf **  pkts,
u32  n_pkts 
)

Definition at line 640 of file hqos.c.

+ Here is the caller graph for this function:

int dpdk_hqos_validate_mask ( u64  mask,
u32  n 
)

Definition at line 171 of file hqos.c.

+ Here is the caller graph for this function:

void* dpdk_input_efd_multiarch_select ( )

+ Here is the caller graph for this function:

void* dpdk_input_multiarch_select ( )

+ Here is the caller graph for this function:

void* dpdk_input_rss_multiarch_select ( )

+ Here is the caller graph for this function:

u32 dpdk_interface_tx_vector ( vlib_main_t vm,
u32  dev_instance 
)

Definition at line 449 of file device.c.

+ Here is the call graph for this function:

u32 dpdk_num_mbufs ( void  )

Definition at line 1102 of file device.c.

clib_error_t* dpdk_port_setup ( dpdk_main_t dm,
dpdk_device_t xd 
)

Definition at line 65 of file init.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t* dpdk_port_setup_hqos ( dpdk_device_t xd,
dpdk_device_config_hqos_t hqos 
)

Definition at line 250 of file hqos.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

struct rte_mbuf* dpdk_replicate_packet_mb ( vlib_buffer_t b)

Definition at line 88 of file device.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 145 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void dpdk_set_flowcontrol_callback ( vlib_main_t vm,
dpdk_flowcontrol_callback_t  callback 
)

Definition at line 985 of file device.c.

int dpdk_set_link_state_poll_interval ( f64  interval)

Definition at line 1692 of file init.c.

+ Here is the caller graph for this function:

clib_error_t* dpdk_set_mac_address ( vnet_hw_interface_t hi,
char *  address 
)

Definition at line 48 of file device.c.

+ Here is the caller graph for this function:

clib_error_t* dpdk_set_mc_filter ( vnet_hw_interface_t hi,
struct ether_addr  mc_addr_vec[],
int  naddr 
)

Definition at line 68 of file device.c.

int dpdk_set_stat_poll_interval ( f64  interval)

Definition at line 1681 of file init.c.

+ Here is the caller graph for this function:

void dpdk_thread_input ( dpdk_main_t dm,
dpdk_device_t xd 
)
void dpdk_update_link_state ( dpdk_device_t xd,
f64  now 
)

Definition at line 1392 of file init.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

struct rte_mbuf* dpdk_zerocopy_replicate_packet_mb ( vlib_buffer_t b)

Definition at line 159 of file device.c.

+ Here is the call 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 757 of file node.c.

+ Here is the call graph for this function:

static_always_inline void increment_efd_drop_counter ( vlib_main_t vm,
u32  counter_index,
u32  count 
)

Definition at line 545 of file dpdk.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 236 of file node.c.

+ Here is the caller graph for this function:

void post_sw_interface_set_flags ( vlib_main_t vm,
u32  sw_if_index,
u32  flags 
)

Definition at line 1062 of file device.c.

+ Here is the call graph for this function:

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

Definition at line 741 of file node.c.

+ Here is the caller graph for this function:

clib_error_t* unformat_hqos ( unformat_input_t input,
dpdk_device_config_hqos_t hqos 
)

Definition at line 788 of file format.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t* unformat_rss_fn ( unformat_input_t input,
uword rss_fn 
)

Definition at line 765 of file format.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void vnet_buffer_needs_dpdk_mb ( vlib_buffer_t b)
static u64 vnet_get_aggregate_rx_packets ( void  )
inlinestatic

Definition at line 564 of file dpdk.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

dpdk_config_main_t dpdk_config_main

Definition at line 400 of file dpdk.h.

vnet_device_class_t dpdk_device_class
vlib_node_registration_t dpdk_input_node

(constructor) VLIB_REGISTER_NODE (dpdk_input_node)

Definition at line 707 of file node.c.

dpdk_main_t dpdk_main

Definition at line 476 of file dpdk.h.

format_function_t format_dpdk_device

Definition at line 606 of file dpdk.h.

format_function_t format_dpdk_device_name

Definition at line 605 of file dpdk.h.

format_function_t format_dpdk_rte_mbuf

Definition at line 609 of file dpdk.h.

format_function_t format_dpdk_rx_dma_trace

Definition at line 608 of file dpdk.h.

format_function_t format_dpdk_rx_rte_mbuf

Definition at line 610 of file dpdk.h.

format_function_t format_dpdk_tx_dma_trace

Definition at line 607 of file dpdk.h.

vlib_node_registration_t handoff_dispatch_node
Initial value:
= {
.name = "handoff-dispatch",
.vector_size = sizeof (u32),
.n_next_nodes = HANDOFF_DISPATCH_N_NEXT,
.next_nodes = {
[HANDOFF_DISPATCH_NEXT_DROP] = "error-drop",
[HANDOFF_DISPATCH_NEXT_IP4_INPUT] = "ip4-input-no-checksum",
},
}
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
static u8 * format_handoff_dispatch_trace(u8 *s, va_list *args)
Definition: handoff.c:348
#define VLIB_NODE_FLAG_IS_HANDOFF
Definition: node.h:256
static uword handoff_dispatch_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: handoff.c:380
#define ARRAY_LEN(x)
Definition: clib.h:59
unsigned int u32
Definition: types.h:88
static char * handoff_dispatch_error_strings[]
Definition: handoff.c:373
u32 flags
Definition: vhost-user.h:75

(constructor) VLIB_REGISTER_NODE (handoff_dispatch_node)

Definition at line 507 of file handoff.c.

unformat_function_t unformat_socket_mem

Definition at line 611 of file dpdk.h.