FD.io VPP  v21.01.1
Vector Packet Processing
avf.h File Reference
+ Include dependency graph for avf.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  avf_rx_desc_t
 
struct  avf_tx_desc_t
 
struct  avf_rxq_t
 
struct  avf_txq_t
 
struct  avf_device_t
 
struct  avf_process_req_t
 
struct  avf_rx_tail_t
 
struct  avf_per_thread_data_t
 
struct  avf_main_t
 
struct  avf_create_if_args_t
 
struct  avf_input_trace_t
 

Macros

#define AVF_QUEUE_SZ_MAX   4096
 
#define AVF_QUEUE_SZ_MIN   64
 
#define AVF_AQ_ENQ_SUSPEND_TIME   50e-6
 
#define AVF_AQ_ENQ_MAX_WAIT_TIME   250e-3
 
#define AVF_RESET_SUSPEND_TIME   20e-3
 
#define AVF_RESET_MAX_WAIT_TIME   1
 
#define AVF_SEND_TO_PF_SUSPEND_TIME   10e-3
 
#define AVF_SEND_TO_PF_MAX_WAIT_TIME   1
 
#define AVF_RXD_STATUS(x)   (1ULL << x)
 
#define AVF_RXD_STATUS_DD   AVF_RXD_STATUS(0)
 
#define AVF_RXD_STATUS_EOP   AVF_RXD_STATUS(1)
 
#define AVF_RXD_ERROR_SHIFT   19
 
#define AVF_RXD_PTYPE_SHIFT   30
 
#define AVF_RXD_LEN_SHIFT   38
 
#define AVF_RX_MAX_DESC_IN_CHAIN   5
 
#define AVF_RXD_ERROR_IPE   (1ULL << (AVF_RXD_ERROR_SHIFT + 3))
 
#define AVF_RXD_ERROR_L4E   (1ULL << (AVF_RXD_ERROR_SHIFT + 4))
 
#define AVF_TXD_CMD(x)   (1 << (x + 4))
 
#define AVF_TXD_CMD_EXT(x, val)   ((u64)val << (x + 4))
 
#define AVF_TXD_CMD_EOP   AVF_TXD_CMD(0)
 
#define AVF_TXD_CMD_RS   AVF_TXD_CMD(1)
 
#define AVF_TXD_CMD_RSV   AVF_TXD_CMD(2)
 
#define AVF_TXD_CMD_IIPT_NONE   AVF_TXD_CMD_EXT(5, 0)
 
#define AVF_TXD_CMD_IIPT_IPV6   AVF_TXD_CMD_EXT(5, 1)
 
#define AVF_TXD_CMD_IIPT_IPV4_NO_CSUM   AVF_TXD_CMD_EXT(5, 2)
 
#define AVF_TXD_CMD_IIPT_IPV4   AVF_TXD_CMD_EXT(5, 3)
 
#define AVF_TXD_CMD_L4T_UNKNOWN   AVF_TXD_CMD_EXT(8, 0)
 
#define AVF_TXD_CMD_L4T_TCP   AVF_TXD_CMD_EXT(8, 1)
 
#define AVF_TXD_CMD_L4T_SCTP   AVF_TXD_CMD_EXT(8, 2)
 
#define AVF_TXD_CMD_L4T_UDP   AVF_TXD_CMD_EXT(8, 3)
 
#define AVF_TXD_OFFSET(x, factor, val)   (((u64)val/(u64)factor) << (16 + x))
 
#define AVF_TXD_OFFSET_MACLEN(val)   AVF_TXD_OFFSET( 0, 2, val)
 
#define AVF_TXD_OFFSET_IPLEN(val)   AVF_TXD_OFFSET( 7, 4, val)
 
#define AVF_TXD_OFFSET_L4LEN(val)   AVF_TXD_OFFSET(14, 4, val)
 
#define AVF_TXD_DTYP_CTX   0x1ULL
 
#define AVF_TXD_CTX_CMD_TSO   AVF_TXD_CMD(0)
 
#define AVF_TXD_CTX_SEG(val, x)   (((u64)val) << (30 + x))
 
#define AVF_TXD_CTX_SEG_TLEN(val)   AVF_TXD_CTX_SEG(val,0)
 
#define AVF_TXD_CTX_SEG_MSS(val)   AVF_TXD_CTX_SEG(val,20)
 
#define avf_log_err(dev, f, ...)
 
#define avf_log_warn(dev, f, ...)
 
#define avf_log_debug(dev, f, ...)
 
#define foreach_avf_device_flags
 
#define AVF_RX_VECTOR_SZ   VLIB_FRAME_SIZE
 
#define foreach_avf_tx_func_error
 

Enumerations

enum  { foreach_avf_device_flags }
 
enum  avf_process_event_t { AVF_PROCESS_EVENT_START = 1, AVF_PROCESS_EVENT_DELETE_IF = 2, AVF_PROCESS_EVENT_AQ_INT = 3, AVF_PROCESS_EVENT_REQ = 4 }
 
enum  avf_process_req_type_t { AVF_PROCESS_REQ_ADD_DEL_ETH_ADDR = 1, AVF_PROCESS_REQ_CONFIG_PROMISC_MDDE = 2 }
 
enum  avf_tx_func_error_t { AVF_TX_N_ERROR }
 

Functions

 STATIC_ASSERT_SIZEOF (avf_rx_desc_t, 32)
 
 STATIC_ASSERT_SIZEOF (avf_tx_desc_t, 16)
 
void avf_create_if (vlib_main_t *vm, avf_create_if_args_t *args)
 
static_always_inline avf_device_tavf_get_device (u32 dev_instance)
 
static u32 avf_get_u32 (void *start, int offset)
 
static u64 avf_get_u64 (void *start, int offset)
 
static u32 avf_get_u32_bits (void *start, int offset, int first, int last)
 
static u64 avf_get_u64_bits (void *start, int offset, int first, int last)
 
static void avf_set_u32 (void *start, int offset, u32 value)
 
static void avf_reg_write (avf_device_t *ad, u32 addr, u32 val)
 
static u32 avf_reg_read (avf_device_t *ad, u32 addr)
 
static void avf_reg_flush (avf_device_t *ad)
 
static_always_inline int avf_rxd_is_not_eop (avf_rx_desc_t *d)
 
static_always_inline int avf_rxd_is_not_dd (avf_rx_desc_t *d)
 

Variables

vlib_log_class_registration_t avf_log
 
avf_main_t avf_main
 
vlib_node_registration_t avf_input_node
 (constructor) VLIB_REGISTER_NODE (avf_input_node) More...
 
vlib_node_registration_t avf_process_node
 (constructor) VLIB_REGISTER_NODE (avf_process_node) More...
 
vnet_device_class_t avf_device_class
 
format_function_t format_avf_device
 
format_function_t format_avf_device_name
 
format_function_t format_avf_input_trace
 

Macro Definition Documentation

◆ AVF_AQ_ENQ_MAX_WAIT_TIME

#define AVF_AQ_ENQ_MAX_WAIT_TIME   250e-3

Definition at line 36 of file avf.h.

◆ AVF_AQ_ENQ_SUSPEND_TIME

#define AVF_AQ_ENQ_SUSPEND_TIME   50e-6

Definition at line 35 of file avf.h.

◆ avf_log_debug

#define avf_log_debug (   dev,
  f,
  ... 
)
Value:
vlib_log (VLIB_LOG_LEVEL_DEBUG, avf_log.class, "%U: " f, \
format_vlib_pci_addr, &dev->pci_addr, \
## __VA_ARGS__)
vlib_log_class_t class
Definition: log.h:84
vlib_log_class_registration_t avf_log
void vlib_log(vlib_log_level_t level, vlib_log_class_t class, char *fmt,...)
Definition: log.c:131
format_function_t format_vlib_pci_addr
Definition: pci.h:326

Definition at line 95 of file avf.h.

◆ avf_log_err

#define avf_log_err (   dev,
  f,
  ... 
)
Value:
vlib_log (VLIB_LOG_LEVEL_ERR, avf_log.class, "%U: " f, \
format_vlib_pci_addr, &dev->pci_addr, \
## __VA_ARGS__)
vlib_log_class_t class
Definition: log.h:84
vlib_log_class_registration_t avf_log
void vlib_log(vlib_log_level_t level, vlib_log_class_t class, char *fmt,...)
Definition: log.c:131
format_function_t format_vlib_pci_addr
Definition: pci.h:326

Definition at line 85 of file avf.h.

◆ avf_log_warn

#define avf_log_warn (   dev,
  f,
  ... 
)
Value:
vlib_log (VLIB_LOG_LEVEL_WARNING, avf_log.class, "%U: " f, \
format_vlib_pci_addr, &dev->pci_addr, \
## __VA_ARGS__)
vlib_log_class_t class
Definition: log.h:84
vlib_log_class_registration_t avf_log
void vlib_log(vlib_log_level_t level, vlib_log_class_t class, char *fmt,...)
Definition: log.c:131
format_function_t format_vlib_pci_addr
Definition: pci.h:326

Definition at line 90 of file avf.h.

◆ AVF_QUEUE_SZ_MAX

#define AVF_QUEUE_SZ_MAX   4096

Definition at line 32 of file avf.h.

◆ AVF_QUEUE_SZ_MIN

#define AVF_QUEUE_SZ_MIN   64

Definition at line 33 of file avf.h.

◆ AVF_RESET_MAX_WAIT_TIME

#define AVF_RESET_MAX_WAIT_TIME   1

Definition at line 39 of file avf.h.

◆ AVF_RESET_SUSPEND_TIME

#define AVF_RESET_SUSPEND_TIME   20e-3

Definition at line 38 of file avf.h.

◆ AVF_RX_MAX_DESC_IN_CHAIN

#define AVF_RX_MAX_DESC_IN_CHAIN   5

Definition at line 50 of file avf.h.

◆ AVF_RX_VECTOR_SZ

#define AVF_RX_VECTOR_SZ   VLIB_FRAME_SIZE

Definition at line 234 of file avf.h.

◆ AVF_RXD_ERROR_IPE

#define AVF_RXD_ERROR_IPE   (1ULL << (AVF_RXD_ERROR_SHIFT + 3))

Definition at line 52 of file avf.h.

◆ AVF_RXD_ERROR_L4E

#define AVF_RXD_ERROR_L4E   (1ULL << (AVF_RXD_ERROR_SHIFT + 4))

Definition at line 53 of file avf.h.

◆ AVF_RXD_ERROR_SHIFT

#define AVF_RXD_ERROR_SHIFT   19

Definition at line 47 of file avf.h.

◆ AVF_RXD_LEN_SHIFT

#define AVF_RXD_LEN_SHIFT   38

Definition at line 49 of file avf.h.

◆ AVF_RXD_PTYPE_SHIFT

#define AVF_RXD_PTYPE_SHIFT   30

Definition at line 48 of file avf.h.

◆ AVF_RXD_STATUS

#define AVF_RXD_STATUS (   x)    (1ULL << x)

Definition at line 44 of file avf.h.

◆ AVF_RXD_STATUS_DD

#define AVF_RXD_STATUS_DD   AVF_RXD_STATUS(0)

Definition at line 45 of file avf.h.

◆ AVF_RXD_STATUS_EOP

#define AVF_RXD_STATUS_EOP   AVF_RXD_STATUS(1)

Definition at line 46 of file avf.h.

◆ AVF_SEND_TO_PF_MAX_WAIT_TIME

#define AVF_SEND_TO_PF_MAX_WAIT_TIME   1

Definition at line 42 of file avf.h.

◆ AVF_SEND_TO_PF_SUSPEND_TIME

#define AVF_SEND_TO_PF_SUSPEND_TIME   10e-3

Definition at line 41 of file avf.h.

◆ AVF_TXD_CMD

#define AVF_TXD_CMD (   x)    (1 << (x + 4))

Definition at line 55 of file avf.h.

◆ AVF_TXD_CMD_EOP

#define AVF_TXD_CMD_EOP   AVF_TXD_CMD(0)

Definition at line 57 of file avf.h.

◆ AVF_TXD_CMD_EXT

#define AVF_TXD_CMD_EXT (   x,
  val 
)    ((u64)val << (x + 4))

Definition at line 56 of file avf.h.

◆ AVF_TXD_CMD_IIPT_IPV4

#define AVF_TXD_CMD_IIPT_IPV4   AVF_TXD_CMD_EXT(5, 3)

Definition at line 64 of file avf.h.

◆ AVF_TXD_CMD_IIPT_IPV4_NO_CSUM

#define AVF_TXD_CMD_IIPT_IPV4_NO_CSUM   AVF_TXD_CMD_EXT(5, 2)

Definition at line 63 of file avf.h.

◆ AVF_TXD_CMD_IIPT_IPV6

#define AVF_TXD_CMD_IIPT_IPV6   AVF_TXD_CMD_EXT(5, 1)

Definition at line 62 of file avf.h.

◆ AVF_TXD_CMD_IIPT_NONE

#define AVF_TXD_CMD_IIPT_NONE   AVF_TXD_CMD_EXT(5, 0)

Definition at line 61 of file avf.h.

◆ AVF_TXD_CMD_L4T_SCTP

#define AVF_TXD_CMD_L4T_SCTP   AVF_TXD_CMD_EXT(8, 2)

Definition at line 68 of file avf.h.

◆ AVF_TXD_CMD_L4T_TCP

#define AVF_TXD_CMD_L4T_TCP   AVF_TXD_CMD_EXT(8, 1)

Definition at line 67 of file avf.h.

◆ AVF_TXD_CMD_L4T_UDP

#define AVF_TXD_CMD_L4T_UDP   AVF_TXD_CMD_EXT(8, 3)

Definition at line 69 of file avf.h.

◆ AVF_TXD_CMD_L4T_UNKNOWN

#define AVF_TXD_CMD_L4T_UNKNOWN   AVF_TXD_CMD_EXT(8, 0)

Definition at line 66 of file avf.h.

◆ AVF_TXD_CMD_RS

#define AVF_TXD_CMD_RS   AVF_TXD_CMD(1)

Definition at line 58 of file avf.h.

◆ AVF_TXD_CMD_RSV

#define AVF_TXD_CMD_RSV   AVF_TXD_CMD(2)

Definition at line 59 of file avf.h.

◆ AVF_TXD_CTX_CMD_TSO

#define AVF_TXD_CTX_CMD_TSO   AVF_TXD_CMD(0)

Definition at line 77 of file avf.h.

◆ AVF_TXD_CTX_SEG

#define AVF_TXD_CTX_SEG (   val,
 
)    (((u64)val) << (30 + x))

Definition at line 78 of file avf.h.

◆ AVF_TXD_CTX_SEG_MSS

#define AVF_TXD_CTX_SEG_MSS (   val)    AVF_TXD_CTX_SEG(val,20)

Definition at line 80 of file avf.h.

◆ AVF_TXD_CTX_SEG_TLEN

#define AVF_TXD_CTX_SEG_TLEN (   val)    AVF_TXD_CTX_SEG(val,0)

Definition at line 79 of file avf.h.

◆ AVF_TXD_DTYP_CTX

#define AVF_TXD_DTYP_CTX   0x1ULL

Definition at line 76 of file avf.h.

◆ AVF_TXD_OFFSET

#define AVF_TXD_OFFSET (   x,
  factor,
  val 
)    (((u64)val/(u64)factor) << (16 + x))

Definition at line 71 of file avf.h.

◆ AVF_TXD_OFFSET_IPLEN

#define AVF_TXD_OFFSET_IPLEN (   val)    AVF_TXD_OFFSET( 7, 4, val)

Definition at line 73 of file avf.h.

◆ AVF_TXD_OFFSET_L4LEN

#define AVF_TXD_OFFSET_L4LEN (   val)    AVF_TXD_OFFSET(14, 4, val)

Definition at line 74 of file avf.h.

◆ AVF_TXD_OFFSET_MACLEN

#define AVF_TXD_OFFSET_MACLEN (   val)    AVF_TXD_OFFSET( 0, 2, val)

Definition at line 72 of file avf.h.

◆ foreach_avf_device_flags

#define foreach_avf_device_flags
Value:
_(0, INITIALIZED, "initialized") \
_(1, ERROR, "error") \
_(2, ADMIN_UP, "admin-up") \
_(3, VA_DMA, "vaddr-dma") \
_(4, LINK_UP, "link-up") \
_(5, SHARED_TXQ_LOCK, "shared-txq-lock") \
_(6, ELOG, "elog") \
_(7, PROMISC, "promisc") \
_(8, RX_INT, "rx-interrupts")
#define ELOG(em, f, data)
Definition: elog.h:474

Definition at line 100 of file avf.h.

◆ foreach_avf_tx_func_error

#define foreach_avf_tx_func_error
Value:
_(SEGMENT_SIZE_EXCEEDED, "segment size exceeded") \
_(NO_FREE_SLOTS, "no free tx slots")

Definition at line 395 of file avf.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
foreach_avf_device_flags 

Definition at line 111 of file avf.h.

◆ avf_process_event_t

Enumerator
AVF_PROCESS_EVENT_START 
AVF_PROCESS_EVENT_DELETE_IF 
AVF_PROCESS_EVENT_AQ_INT 
AVF_PROCESS_EVENT_REQ 

Definition at line 236 of file avf.h.

◆ avf_process_req_type_t

Enumerator
AVF_PROCESS_REQ_ADD_DEL_ETH_ADDR 
AVF_PROCESS_REQ_CONFIG_PROMISC_MDDE 

Definition at line 244 of file avf.h.

◆ avf_tx_func_error_t

Enumerator
AVF_TX_N_ERROR 

Definition at line 399 of file avf.h.

Function Documentation

◆ avf_create_if()

void avf_create_if ( vlib_main_t vm,
avf_create_if_args_t args 
)

Definition at line 1508 of file device.c.

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

◆ avf_get_device()

static_always_inline avf_device_t* avf_get_device ( u32  dev_instance)

Definition at line 311 of file avf.h.

+ Here is the caller graph for this function:

◆ avf_get_u32()

static u32 avf_get_u32 ( void *  start,
int  offset 
)
inlinestatic

Definition at line 317 of file avf.h.

+ Here is the caller graph for this function:

◆ avf_get_u32_bits()

static u32 avf_get_u32_bits ( void *  start,
int  offset,
int  first,
int  last 
)
inlinestatic

Definition at line 329 of file avf.h.

+ Here is the call graph for this function:

◆ avf_get_u64()

static u64 avf_get_u64 ( void *  start,
int  offset 
)
inlinestatic

Definition at line 323 of file avf.h.

+ Here is the caller graph for this function:

◆ avf_get_u64_bits()

static u64 avf_get_u64_bits ( void *  start,
int  offset,
int  first,
int  last 
)
inlinestatic

Definition at line 340 of file avf.h.

+ Here is the call graph for this function:

◆ avf_reg_flush()

static void avf_reg_flush ( avf_device_t ad)
inlinestatic

Definition at line 369 of file avf.h.

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

◆ avf_reg_read()

static u32 avf_reg_read ( avf_device_t ad,
u32  addr 
)
inlinestatic

Definition at line 363 of file avf.h.

+ Here is the caller graph for this function:

◆ avf_reg_write()

static void avf_reg_write ( avf_device_t ad,
u32  addr,
u32  val 
)
inlinestatic

Definition at line 357 of file avf.h.

+ Here is the caller graph for this function:

◆ avf_rxd_is_not_dd()

static_always_inline int avf_rxd_is_not_dd ( avf_rx_desc_t d)

Definition at line 382 of file avf.h.

+ Here is the caller graph for this function:

◆ avf_rxd_is_not_eop()

static_always_inline int avf_rxd_is_not_eop ( avf_rx_desc_t d)

Definition at line 376 of file avf.h.

+ Here is the caller graph for this function:

◆ avf_set_u32()

static void avf_set_u32 ( void *  start,
int  offset,
u32  value 
)
inlinestatic

Definition at line 351 of file avf.h.

◆ STATIC_ASSERT_SIZEOF() [1/2]

STATIC_ASSERT_SIZEOF ( avf_rx_desc_t  ,
32   
)

◆ STATIC_ASSERT_SIZEOF() [2/2]

STATIC_ASSERT_SIZEOF ( avf_tx_desc_t  ,
16   
)

Variable Documentation

◆ avf_device_class

vnet_device_class_t avf_device_class

◆ avf_input_node

vlib_node_registration_t avf_input_node

(constructor) VLIB_REGISTER_NODE (avf_input_node)

Definition at line 465 of file input.c.

◆ avf_log

◆ avf_main

avf_main_t avf_main

Definition at line 43 of file device.c.

◆ avf_process_node

vlib_node_registration_t avf_process_node

(constructor) VLIB_REGISTER_NODE (avf_process_node)

Definition at line 1326 of file device.c.

◆ format_avf_device

format_function_t format_avf_device

Definition at line 306 of file avf.h.

◆ format_avf_device_name

format_function_t format_avf_device_name

Definition at line 307 of file avf.h.

◆ format_avf_input_trace

format_function_t format_avf_input_trace

Definition at line 308 of file avf.h.