FD.io VPP  v21.01.1
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_flow_entry_t
 
struct  dpdk_flow_lookup_entry_t
 
struct  dpdk_rx_queue_t
 
struct  dpdk_tx_queue_t
 
struct  dpdk_device_t
 
struct  dpdk_device_config_t
 
struct  dpdk_config_main_t
 
struct  dpdk_per_thread_data_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 DPDK_MLX5_PMD_NAME   "mlx5_pci"
 
#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 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_DEVICE_TSO_DEFAULT   0
 
#define DPDK_DEVICE_TSO_OFF   1
 
#define DPDK_DEVICE_TSO_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__)
 
#define foreach_dpdk_rss_hf
 

Typedefs

typedef uint16_t dpdk_portid_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_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_NETVSC, VNET_DPDK_PORT_TYPE_UNKNOWN
}
 
enum  { foreach_dpdk_device_flags }
 
enum  dpdk_error_t { DPDK_N_ERROR }
 

Functions

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)
 
struct rte_pci_device * dpdk_get_pci_device (const struct rte_eth_dev_info *info)
 
void dpdk_cli_reference (void)
 

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 admin_up_down_process_node
 (constructor) VLIB_REGISTER_NODE (admin_up_down_process_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
 
format_function_t format_dpdk_rss_hf_name
 
format_function_t format_dpdk_rx_offload_caps
 
format_function_t format_dpdk_tx_offload_caps
 
vnet_flow_dev_ops_function_t dpdk_flow_ops_fn
 

Macro Definition Documentation

◆ ALLOW_EXPERIMENTAL_API

#define ALLOW_EXPERIMENTAL_API

Definition at line 21 of file dpdk.h.

◆ always_inline

#define always_inline   static inline

Definition at line 49 of file dpdk.h.

◆ DPDK_DEVICE_TSO_DEFAULT

#define DPDK_DEVICE_TSO_DEFAULT   0

Definition at line 271 of file dpdk.h.

◆ DPDK_DEVICE_TSO_OFF

#define DPDK_DEVICE_TSO_OFF   1

Definition at line 272 of file dpdk.h.

◆ DPDK_DEVICE_TSO_ON

#define DPDK_DEVICE_TSO_ON   2

Definition at line 273 of file dpdk.h.

◆ DPDK_DEVICE_VLAN_STRIP_DEFAULT

#define DPDK_DEVICE_VLAN_STRIP_DEFAULT   0

Definition at line 259 of file dpdk.h.

◆ DPDK_DEVICE_VLAN_STRIP_OFF

#define DPDK_DEVICE_VLAN_STRIP_OFF   1

Definition at line 260 of file dpdk.h.

◆ DPDK_DEVICE_VLAN_STRIP_ON

#define DPDK_DEVICE_VLAN_STRIP_ON   2

Definition at line 261 of file dpdk.h.

◆ DPDK_LINK_POLL_INTERVAL

#define DPDK_LINK_POLL_INTERVAL   (3.0)

Definition at line 243 of file dpdk.h.

◆ dpdk_log_err

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

Definition at line 407 of file dpdk.h.

◆ dpdk_log_info

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

Definition at line 413 of file dpdk.h.

◆ dpdk_log_notice

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

Definition at line 411 of file dpdk.h.

◆ dpdk_log_warn

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

Definition at line 409 of file dpdk.h.

◆ DPDK_MIN_LINK_POLL_INTERVAL

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

Definition at line 244 of file dpdk.h.

◆ DPDK_MIN_STATS_POLL_INTERVAL

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

Definition at line 241 of file dpdk.h.

◆ DPDK_MLX5_PMD_NAME

#define DPDK_MLX5_PMD_NAME   "mlx5_pci"

Definition at line 64 of file dpdk.h.

◆ DPDK_RX_BURST_SZ

#define DPDK_RX_BURST_SZ   VLIB_FRAME_SIZE

Definition at line 313 of file dpdk.h.

◆ DPDK_STATS_POLL_INTERVAL

#define DPDK_STATS_POLL_INTERVAL   (10.0)

Definition at line 240 of file dpdk.h.

◆ foreach_dpdk_device_config_item

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

Definition at line 246 of file dpdk.h.

◆ foreach_dpdk_device_flags

#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") \
_( 9, TX_OFFLOAD, "tx-offload") \
_(10, INTEL_PHDR_CKSUM, "intel-phdr-cksum") \
_(11, RX_FLOW_OFFLOAD, "rx-flow-offload") \
_(12, RX_IP4_CKSUM, "rx-ip4-cksum")

Definition at line 129 of file dpdk.h.

◆ foreach_dpdk_error

#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 390 of file dpdk.h.

◆ foreach_dpdk_pmd

#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_ice", ICE) \
_ ("net_iavf", IAVF) \
_ ("net_virtio", VIRTIO) \
_ ("net_enic", ENIC) \
_ ("net_vmxnet3", VMXNET3) \
_ ("AF_PACKET PMD", AF_PACKET) \
_ ("net_fm10k", FM10K) \
_ ("net_cxgbe", CXGBE) \
_ ("net_mlx4", MLX4) \
_ (DPDK_MLX5_PMD_NAME, 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) \
_ ("net_netvsc", NETVSC) \
_ ("net_bnxt", BNXT)
#define DPDK_MLX5_PMD_NAME
Definition: dpdk.h:64

Definition at line 67 of file dpdk.h.

◆ foreach_dpdk_rss_hf

#define foreach_dpdk_rss_hf
Value:
_(0, ETH_RSS_FRAG_IPV4, "ipv4-frag") \
_(1, ETH_RSS_NONFRAG_IPV4_TCP, "ipv4-tcp") \
_(2, ETH_RSS_NONFRAG_IPV4_UDP, "ipv4-udp") \
_(3, ETH_RSS_NONFRAG_IPV4_SCTP, "ipv4-sctp") \
_(4, ETH_RSS_NONFRAG_IPV4_OTHER, "ipv4-other") \
_(5, ETH_RSS_IPV4, "ipv4") \
_(6, ETH_RSS_IPV6_TCP_EX, "ipv6-tcp-ex") \
_(7, ETH_RSS_IPV6_UDP_EX, "ipv6-udp-ex") \
_(8, ETH_RSS_FRAG_IPV6, "ipv6-frag") \
_(9, ETH_RSS_NONFRAG_IPV6_TCP, "ipv6-tcp") \
_(10, ETH_RSS_NONFRAG_IPV6_UDP, "ipv6-udp") \
_(11, ETH_RSS_NONFRAG_IPV6_SCTP, "ipv6-sctp") \
_(12, ETH_RSS_NONFRAG_IPV6_OTHER, "ipv6-other") \
_(13, ETH_RSS_IPV6_EX, "ipv6-ex") \
_(14, ETH_RSS_IPV6, "ipv6") \
_(15, ETH_RSS_L2_PAYLOAD, "l2-payload") \
_(16, ETH_RSS_PORT, "port") \
_(17, ETH_RSS_VXLAN, "vxlan") \
_(18, ETH_RSS_GENEVE, "geneve") \
_(19, ETH_RSS_NVGRE, "nvgre") \
_(20, ETH_RSS_GTPU, "gtpu") \
_(60, ETH_RSS_L4_DST_ONLY, "l4-dst-only") \
_(61, ETH_RSS_L4_SRC_ONLY, "l4-src-only") \
_(62, ETH_RSS_L3_DST_ONLY, "l3-dst-only") \
_(63, ETH_RSS_L3_SRC_ONLY, "l3-src-only")

Definition at line 418 of file dpdk.h.

Typedef Documentation

◆ dpdk_portid_t

typedef uint16_t dpdk_portid_t

Definition at line 127 of file dpdk.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
foreach_dpdk_device_flags 

Definition at line 141 of file dpdk.h.

◆ dpdk_error_t

Enumerator
DPDK_N_ERROR 

Definition at line 399 of file dpdk.h.

◆ dpdk_pmd_t

enum dpdk_pmd_t
Enumerator
VNET_DPDK_PMD_NONE 
VNET_DPDK_PMD_UNKNOWN 

Definition at line 96 of file dpdk.h.

◆ dpdk_port_type_t

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_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_NETVSC 
VNET_DPDK_PORT_TYPE_UNKNOWN 

Definition at line 105 of file dpdk.h.

Function Documentation

◆ dpdk_cli_reference()

void dpdk_cli_reference ( void  )

Definition at line 389 of file cli.c.

+ Here is the caller graph for this function:

◆ dpdk_device_setup()

void dpdk_device_setup ( dpdk_device_t xd)

Definition at line 39 of file common.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dpdk_device_start()

void dpdk_device_start ( dpdk_device_t xd)

Definition at line 166 of file common.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dpdk_device_stop()

void dpdk_device_stop ( dpdk_device_t xd)

Definition at line 200 of file common.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dpdk_get_pci_device()

struct rte_pci_device* dpdk_get_pci_device ( const struct rte_eth_dev_info *  info)

Definition at line 252 of file common.c.

+ Here is the caller graph for this function:

◆ dpdk_port_state_callback()

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

Definition at line 242 of file common.c.

+ Here is the call graph for this function:

◆ dpdk_update_link_state()

void dpdk_update_link_state ( dpdk_device_t xd,
f64  now 
)

Definition at line 1554 of file init.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unformat_rss_fn()

clib_error_t* unformat_rss_fn ( unformat_input_t input,
uword rss_fn 
)

Definition at line 939 of file format.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ admin_up_down_process_node

vlib_node_registration_t admin_up_down_process_node

(constructor) VLIB_REGISTER_NODE (admin_up_down_process_node)

Definition at line 763 of file device.c.

◆ dpdk_config_main

dpdk_config_main_t dpdk_config_main

Definition at line 48 of file init.c.

◆ dpdk_device_class

vnet_device_class_t dpdk_device_class

◆ dpdk_flow_ops_fn

vnet_flow_dev_ops_function_t dpdk_flow_ops_fn

Definition at line 456 of file dpdk.h.

◆ dpdk_input_node

vlib_node_registration_t dpdk_input_node

(constructor) VLIB_REGISTER_NODE (dpdk_input_node)

Definition at line 485 of file node.c.

◆ dpdk_main

dpdk_main_t dpdk_main

Definition at line 47 of file init.c.

◆ format_dpdk_device

format_function_t format_dpdk_device

Definition at line 446 of file dpdk.h.

◆ format_dpdk_device_errors

format_function_t format_dpdk_device_errors

Definition at line 447 of file dpdk.h.

◆ format_dpdk_device_name

format_function_t format_dpdk_device_name

Definition at line 445 of file dpdk.h.

◆ format_dpdk_flow

format_function_t format_dpdk_flow

Definition at line 452 of file dpdk.h.

◆ format_dpdk_rss_hf_name

format_function_t format_dpdk_rss_hf_name

Definition at line 453 of file dpdk.h.

◆ format_dpdk_rte_mbuf

format_function_t format_dpdk_rte_mbuf

Definition at line 450 of file dpdk.h.

◆ format_dpdk_rx_offload_caps

format_function_t format_dpdk_rx_offload_caps

Definition at line 454 of file dpdk.h.

◆ format_dpdk_rx_rte_mbuf

format_function_t format_dpdk_rx_rte_mbuf

Definition at line 451 of file dpdk.h.

◆ format_dpdk_rx_trace

format_function_t format_dpdk_rx_trace

Definition at line 449 of file dpdk.h.

◆ format_dpdk_tx_offload_caps

format_function_t format_dpdk_tx_offload_caps

Definition at line 455 of file dpdk.h.

◆ format_dpdk_tx_trace

format_function_t format_dpdk_tx_trace

Definition at line 448 of file dpdk.h.