FD.io VPP  v18.07.1-19-g511ce25
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_device_hqos_per_worker_thread_t
 
struct  dpdk_device_hqos_per_hqos_thread_t
 
struct  dpdk_flow_entry_t
 
struct  dpdk_flow_lookup_entry_t
 
struct  dpdk_device_t
 
struct  dpdk_device_and_queue_t
 
struct  dpdk_device_config_hqos_t
 
struct  dpdk_device_config_t
 
struct  dpdk_config_main_t
 
struct  dpdk_per_thread_data_t
 
struct  dpdk_pcap_t
 
struct  dpdk_main_t
 
struct  dpdk_tx_trace_t
 
struct  dpdk_rx_trace_t
 

Macros

#define ALLOW_EXPERIMENTAL_API
 
#define always_inline   static inline
 
#define NB_MBUF   (16<<10)
 
#define foreach_dpdk_pmd
 
#define foreach_dpdk_device_flags
 
#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_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 DPDK_RX_BURST_SZ   VLIB_FRAME_SIZE
 
#define foreach_dpdk_error
 
#define dpdk_log_err(...)   vlib_log(VLIB_LOG_LEVEL_ERR, dpdk_main.log_default, __VA_ARGS__)
 
#define dpdk_log_warn(...)   vlib_log(VLIB_LOG_LEVEL_WARNING, dpdk_main.log_default, __VA_ARGS__)
 
#define dpdk_log_notice(...)   vlib_log(VLIB_LOG_LEVEL_NOTICE, dpdk_main.log_default, __VA_ARGS__)
 
#define dpdk_log_info(...)   vlib_log(VLIB_LOG_LEVEL_INFO, dpdk_main.log_default, __VA_ARGS__)
 

Typedefs

typedef uint16_t dpdk_portid_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_2_5G, VNET_DPDK_PORT_TYPE_ETH_5G, VNET_DPDK_PORT_TYPE_ETH_10G,
  VNET_DPDK_PORT_TYPE_ETH_20G, VNET_DPDK_PORT_TYPE_ETH_25G, VNET_DPDK_PORT_TYPE_ETH_40G, VNET_DPDK_PORT_TYPE_ETH_50G,
  VNET_DPDK_PORT_TYPE_ETH_56G, VNET_DPDK_PORT_TYPE_ETH_100G, VNET_DPDK_PORT_TYPE_ETH_BOND, VNET_DPDK_PORT_TYPE_ETH_SWITCH,
  VNET_DPDK_PORT_TYPE_AF_PACKET, VNET_DPDK_PORT_TYPE_ETH_VF, VNET_DPDK_PORT_TYPE_VIRTIO_USER, VNET_DPDK_PORT_TYPE_VHOST_ETHER,
  VNET_DPDK_PORT_TYPE_FAILSAFE, VNET_DPDK_PORT_TYPE_UNKNOWN
}
 
enum  { foreach_dpdk_device_flags }
 
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 dpdk_device_setup (dpdk_device_t *xd)
 
void dpdk_device_start (dpdk_device_t *xd)
 
void dpdk_device_stop (dpdk_device_t *xd)
 
int dpdk_port_state_callback (dpdk_portid_t port_id, enum rte_eth_event_type type, void *param, void *ret_param)
 
void dpdk_update_link_state (dpdk_device_t *xd, f64 now)
 
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)
 
clib_error_tdpdk_pool_create (vlib_main_t *vm, u8 *pool_name, u32 elt_size, u32 num_elts, u32 pool_priv_size, u16 cache_size, u8 numa, struct rte_mempool **_mp, vlib_physmem_region_index_t *pri)
 
clib_error_tdpdk_buffer_pool_create (vlib_main_t *vm, unsigned num_mbufs, unsigned socket_id)
 

Variables

vnet_device_class_t dpdk_device_class
 
vlib_node_registration_t dpdk_input_node
 (constructor) VLIB_REGISTER_NODE (dpdk_input_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_device_errors
 
format_function_t format_dpdk_tx_trace
 
format_function_t format_dpdk_rx_trace
 
format_function_t format_dpdk_rte_mbuf
 
format_function_t format_dpdk_rx_rte_mbuf
 
format_function_t format_dpdk_flow
 
unformat_function_t unformat_dpdk_log_level
 
vnet_flow_dev_ops_function_t dpdk_flow_ops_fn
 

Macro Definition Documentation

#define ALLOW_EXPERIMENTAL_API

Definition at line 21 of file dpdk.h.

#define always_inline   static inline

Definition at line 51 of file dpdk.h.

#define DPDK_DEVICE_VLAN_STRIP_DEFAULT   0

Definition at line 333 of file dpdk.h.

#define DPDK_DEVICE_VLAN_STRIP_OFF   1

Definition at line 334 of file dpdk.h.

#define DPDK_DEVICE_VLAN_STRIP_ON   2

Definition at line 335 of file dpdk.h.

#define DPDK_HQOS_DBG_BYPASS   0

Definition at line 282 of file dpdk.h.

#define DPDK_LINK_POLL_INTERVAL   (3.0)

Definition at line 272 of file dpdk.h.

#define dpdk_log_err (   ...)    vlib_log(VLIB_LOG_LEVEL_ERR, dpdk_main.log_default, __VA_ARGS__)

Definition at line 500 of file dpdk.h.

#define dpdk_log_info (   ...)    vlib_log(VLIB_LOG_LEVEL_INFO, dpdk_main.log_default, __VA_ARGS__)

Definition at line 506 of file dpdk.h.

#define dpdk_log_notice (   ...)    vlib_log(VLIB_LOG_LEVEL_NOTICE, dpdk_main.log_default, __VA_ARGS__)

Definition at line 504 of file dpdk.h.

#define dpdk_log_warn (   ...)    vlib_log(VLIB_LOG_LEVEL_WARNING, dpdk_main.log_default, __VA_ARGS__)

Definition at line 502 of file dpdk.h.

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

Definition at line 273 of file dpdk.h.

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

Definition at line 270 of file dpdk.h.

#define DPDK_RX_BURST_SZ   VLIB_FRAME_SIZE

Definition at line 378 of file dpdk.h.

#define DPDK_STATS_POLL_INTERVAL   (10.0)

Definition at line 269 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 321 of file dpdk.h.

#define foreach_dpdk_device_flags
Value:
_( 0, ADMIN_UP, "admin-up") \
_( 1, PROMISC, "promisc") \
_( 2, PMD, "pmd") \
_( 3, PMD_INIT_FAIL, "pmd-init-fail") \
_( 4, MAYBE_MULTISEG, "maybe-multiseg") \
_( 5, HAVE_SUBIF, "subif") \
_( 6, HQOS, "hqos") \
_( 7, BOND_SLAVE, "bond-slave") \
_( 8, BOND_SLAVE_UP, "bond-slave-up") \
_( 9, TX_OFFLOAD, "tx-offload") \
_(10, INTEL_PHDR_CKSUM, "intel-phdr-cksum") \
_(11, RX_FLOW_OFFLOAD, "rx-flow-offload")

Definition at line 157 of file dpdk.h.

#define foreach_dpdk_error
Value:
_(NONE, "no error") \
_(RX_PACKET_ERROR, "Rx packet errors") \
_(RX_BAD_FCS, "Rx bad fcs") \
_(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")

Definition at line 483 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) \
_ ("AF_PACKET PMD", AF_PACKET) \
_ ("net_bonding", BOND) \
_ ("net_fm10k", FM10K) \
_ ("net_cxgbe", CXGBE) \
_ ("net_mlx4", MLX4) \
_ ("net_mlx5", MLX5) \
_ ("net_dpaa2", DPAA2) \
_ ("net_virtio_user", VIRTIO_USER) \
_ ("net_vhost", VHOST_ETHER) \
_ ("net_ena", ENA) \
_ ("net_failsafe", FAILSAFE) \
_ ("net_liovf", LIOVF_ETHER) \
_ ("net_qede", QEDE)

Definition at line 64 of file dpdk.h.

#define HQOS_FLUSH_COUNT_THRESHOLD   100000

Definition at line 286 of file dpdk.h.

#define NB_MBUF   (16<<10)

Definition at line 59 of file dpdk.h.

Typedef Documentation

typedef uint16_t dpdk_portid_t

Definition at line 121 of file dpdk.h.

Enumeration Type Documentation

anonymous enum
Enumerator
foreach_dpdk_device_flags 

Definition at line 171 of file dpdk.h.

Enumerator
DPDK_N_ERROR 

Definition at line 492 of file dpdk.h.

enum dpdk_pmd_t
Enumerator
VNET_DPDK_PMD_NONE 
VNET_DPDK_PMD_UNKNOWN 

Definition at line 90 of file dpdk.h.

Enumerator
VNET_DPDK_PORT_TYPE_ETH_1G 
VNET_DPDK_PORT_TYPE_ETH_2_5G 
VNET_DPDK_PORT_TYPE_ETH_5G 
VNET_DPDK_PORT_TYPE_ETH_10G 
VNET_DPDK_PORT_TYPE_ETH_20G 
VNET_DPDK_PORT_TYPE_ETH_25G 
VNET_DPDK_PORT_TYPE_ETH_40G 
VNET_DPDK_PORT_TYPE_ETH_50G 
VNET_DPDK_PORT_TYPE_ETH_56G 
VNET_DPDK_PORT_TYPE_ETH_100G 
VNET_DPDK_PORT_TYPE_ETH_BOND 
VNET_DPDK_PORT_TYPE_ETH_SWITCH 
VNET_DPDK_PORT_TYPE_AF_PACKET 
VNET_DPDK_PORT_TYPE_ETH_VF 
VNET_DPDK_PORT_TYPE_VIRTIO_USER 
VNET_DPDK_PORT_TYPE_VHOST_ETHER 
VNET_DPDK_PORT_TYPE_FAILSAFE 
VNET_DPDK_PORT_TYPE_UNKNOWN 

Definition at line 99 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 700 of file device.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t* dpdk_buffer_pool_create ( vlib_main_t vm,
unsigned  num_mbufs,
unsigned  socket_id 
)

Definition at line 542 of file buffer.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 205 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 197 of file hqos.c.

void dpdk_device_setup ( dpdk_device_t xd)

Definition at line 40 of file common.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void dpdk_device_start ( dpdk_device_t xd)

Definition at line 143 of file common.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void dpdk_device_stop ( dpdk_device_t xd)

Definition at line 190 of file common.c.

+ Here is the caller graph for this function:

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 168 of file hqos.c.

+ Here is the caller graph for this function:

clib_error_t* dpdk_pool_create ( vlib_main_t vm,
u8 pool_name,
u32  elt_size,
u32  num_elts,
u32  pool_priv_size,
u16  cache_size,
u8  numa,
struct rte_mempool **  _mp,
vlib_physmem_region_index_t pri 
)

Definition at line 454 of file buffer.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 247 of file hqos.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int dpdk_port_state_callback ( dpdk_portid_t  port_id,
enum rte_eth_event_type  type,
void *  param,
void *  ret_param 
)

Definition at line 319 of file common.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void dpdk_update_link_state ( dpdk_device_t xd,
f64  now 
)

Definition at line 1421 of file init.c.

+ Here is the call graph for this function:

+ 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 872 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 835 of file format.c.

+ 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 43 of file init.c.

vnet_device_class_t dpdk_device_class
vnet_flow_dev_ops_function_t dpdk_flow_ops_fn

Definition at line 520 of file dpdk.h.

vlib_node_registration_t dpdk_input_node

(constructor) VLIB_REGISTER_NODE (dpdk_input_node)

Definition at line 649 of file node.c.

dpdk_main_t dpdk_main

Definition at line 42 of file init.c.

format_function_t format_dpdk_device

Definition at line 512 of file dpdk.h.

format_function_t format_dpdk_device_errors

Definition at line 513 of file dpdk.h.

format_function_t format_dpdk_device_name

Definition at line 511 of file dpdk.h.

format_function_t format_dpdk_flow

Definition at line 518 of file dpdk.h.

format_function_t format_dpdk_rte_mbuf

Definition at line 516 of file dpdk.h.

format_function_t format_dpdk_rx_rte_mbuf

Definition at line 517 of file dpdk.h.

format_function_t format_dpdk_rx_trace

Definition at line 515 of file dpdk.h.

format_function_t format_dpdk_tx_trace

Definition at line 514 of file dpdk.h.

unformat_function_t unformat_dpdk_log_level

Definition at line 519 of file dpdk.h.