FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
device.c File Reference
+ Include dependency graph for device.c:

Go to the source code of this file.

Data Structures

struct  virtchnl_promisc_info_t
 

Macros

#define AVF_MBOX_LEN   64
 
#define AVF_MBOX_BUF_SZ   4096
 
#define AVF_RXQ_SZ   512
 
#define AVF_TXQ_SZ   512
 
#define AVF_ITR_INT   250
 
#define PCI_VENDOR_ID_INTEL   0x8086
 
#define PCI_DEVICE_ID_INTEL_AVF   0x1889
 
#define PCI_DEVICE_ID_INTEL_X710_VF   0x154c
 
#define PCI_DEVICE_ID_INTEL_X722_VF   0x37cd
 

Enumerations

enum  avf_irq_state_t { AVF_IRQ_STATE_DISABLED, AVF_IRQ_STATE_ENABLED, AVF_IRQ_STATE_WB_ON_ITR }
 

Functions

 VLIB_REGISTER_LOG_CLASS (avf_log)
 
 VLIB_REGISTER_LOG_CLASS (avf_stats_log)
 
void avf_delete_if (vlib_main_t *vm, avf_device_t *ad, int with_barrier)
 
static void avf_irq_0_set_state (avf_device_t *ad, avf_irq_state_t state)
 
static void avf_irq_n_set_state (avf_device_t *ad, u8 line, avf_irq_state_t state)
 
clib_error_tavf_aq_desc_enq (vlib_main_t *vm, avf_device_t *ad, avf_aq_desc_t *dt, void *data, int len)
 
clib_error_tavf_cmd_rx_ctl_reg_write (vlib_main_t *vm, avf_device_t *ad, u32 reg, u32 val)
 
clib_error_tavf_rxq_init (vlib_main_t *vm, avf_device_t *ad, u16 qid, u16 rxq_size)
 
clib_error_tavf_txq_init (vlib_main_t *vm, avf_device_t *ad, u16 qid, u16 txq_size)
 
void avf_arq_slot_init (avf_device_t *ad, u16 slot)
 
static uword avf_dma_addr (vlib_main_t *vm, avf_device_t *ad, void *p)
 
static void avf_adminq_init (vlib_main_t *vm, avf_device_t *ad)
 
clib_error_tavf_send_to_pf (vlib_main_t *vm, avf_device_t *ad, virtchnl_ops_t op, void *in, int in_len, void *out, int out_len)
 
clib_error_tavf_op_version (vlib_main_t *vm, avf_device_t *ad, virtchnl_version_info_t *ver)
 
clib_error_tavf_op_get_vf_resources (vlib_main_t *vm, avf_device_t *ad, virtchnl_vf_resource_t *res)
 
clib_error_tavf_op_config_rss_lut (vlib_main_t *vm, avf_device_t *ad)
 
clib_error_tavf_op_config_rss_key (vlib_main_t *vm, avf_device_t *ad)
 
clib_error_tavf_op_disable_vlan_stripping (vlib_main_t *vm, avf_device_t *ad)
 
clib_error_tavf_op_config_promisc_mode (vlib_main_t *vm, avf_device_t *ad, int is_enable)
 
clib_error_tavf_op_config_vsi_queues (vlib_main_t *vm, avf_device_t *ad)
 
clib_error_tavf_op_config_irq_map (vlib_main_t *vm, avf_device_t *ad)
 
clib_error_tavf_op_add_del_eth_addr (vlib_main_t *vm, avf_device_t *ad, u8 count, u8 *macs, int is_add)
 
clib_error_tavf_op_enable_queues (vlib_main_t *vm, avf_device_t *ad, u32 rx, u32 tx)
 
clib_error_tavf_op_get_stats (vlib_main_t *vm, avf_device_t *ad, virtchnl_eth_stats_t *es)
 
clib_error_tavf_op_get_offload_vlan_v2_caps (vlib_main_t *vm, avf_device_t *ad, virtchnl_vlan_caps_t *vc)
 
clib_error_tavf_op_disable_vlan_stripping_v2 (vlib_main_t *vm, avf_device_t *ad, u32 outer, u32 inner)
 
clib_error_tavf_device_reset (vlib_main_t *vm, avf_device_t *ad)
 
clib_error_tavf_request_queues (vlib_main_t *vm, avf_device_t *ad, u16 num_queue_pairs)
 
clib_error_tavf_device_init (vlib_main_t *vm, avf_main_t *am, avf_device_t *ad, avf_create_if_args_t *args)
 
void avf_process_one_device (vlib_main_t *vm, avf_device_t *ad, int is_irq)
 
clib_error_tavf_op_program_flow (vlib_main_t *vm, avf_device_t *ad, int is_create, u8 *rule, u32 rule_len, u8 *program_status, u32 status_len)
 
static void avf_process_handle_request (vlib_main_t *vm, avf_process_req_t *req)
 
static clib_error_tavf_process_request (vlib_main_t *vm, avf_process_req_t *req)
 
static u32 avf_flag_change (vnet_main_t *vnm, vnet_hw_interface_t *hw, u32 flags)
 
static uword avf_process (vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
 
static void avf_irq_0_handler (vlib_main_t *vm, vlib_pci_dev_handle_t h, u16 line)
 
static void avf_irq_n_handler (vlib_main_t *vm, vlib_pci_dev_handle_t h, u16 line)
 
static u8 avf_validate_queue_size (avf_create_if_args_t *args)
 
void avf_create_if (vlib_main_t *vm, avf_create_if_args_t *args)
 
static clib_error_tavf_interface_admin_up_down (vnet_main_t *vnm, u32 hw_if_index, u32 flags)
 
static clib_error_tavf_interface_rx_mode_change (vnet_main_t *vnm, u32 hw_if_index, u32 qid, vnet_hw_if_rx_mode mode)
 
static void avf_set_interface_next_node (vnet_main_t *vnm, u32 hw_if_index, u32 node_index)
 
static clib_error_tavf_add_del_mac_address (vnet_hw_interface_t *hw, const u8 *address, u8 is_add)
 
static void avf_clear_hw_interface_counters (u32 instance)
 
clib_error_tavf_program_flow (u32 dev_instance, int is_add, u8 *rule, u32 rule_len, u8 *program_status, u32 status_len)
 
 VNET_DEVICE_CLASS (avf_device_class,)
 
clib_error_tavf_init (vlib_main_t *vm)
 

Variables

avf_main_t avf_main
 
static pci_device_id_t avf_pci_device_ids []
 
const static char * virtchnl_event_names []
 
vlib_node_registration_t avf_process_node
 (constructor) VLIB_REGISTER_NODE (avf_process_node) More...
 
static char * avf_tx_func_error_strings []
 

Macro Definition Documentation

◆ AVF_ITR_INT

#define AVF_ITR_INT   250

Definition at line 32 of file device.c.

◆ AVF_MBOX_BUF_SZ

#define AVF_MBOX_BUF_SZ   4096

Definition at line 29 of file device.c.

◆ AVF_MBOX_LEN

#define AVF_MBOX_LEN   64

Definition at line 28 of file device.c.

◆ AVF_RXQ_SZ

#define AVF_RXQ_SZ   512

Definition at line 30 of file device.c.

◆ AVF_TXQ_SZ

#define AVF_TXQ_SZ   512

Definition at line 31 of file device.c.

◆ PCI_DEVICE_ID_INTEL_AVF

#define PCI_DEVICE_ID_INTEL_AVF   0x1889

Definition at line 35 of file device.c.

◆ PCI_DEVICE_ID_INTEL_X710_VF

#define PCI_DEVICE_ID_INTEL_X710_VF   0x154c

Definition at line 36 of file device.c.

◆ PCI_DEVICE_ID_INTEL_X722_VF

#define PCI_DEVICE_ID_INTEL_X722_VF   0x37cd

Definition at line 37 of file device.c.

◆ PCI_VENDOR_ID_INTEL

#define PCI_VENDOR_ID_INTEL   0x8086

Definition at line 34 of file device.c.

Enumeration Type Documentation

◆ avf_irq_state_t

Enumerator
AVF_IRQ_STATE_DISABLED 
AVF_IRQ_STATE_ENABLED 
AVF_IRQ_STATE_WB_ON_ITR 

Definition at line 64 of file device.c.

Function Documentation

◆ avf_add_del_mac_address()

static clib_error_t* avf_add_del_mac_address ( vnet_hw_interface_t hw,
const u8 address,
u8  is_add 
)
static

Definition at line 1857 of file device.c.

+ Here is the call graph for this function:

◆ avf_adminq_init()

static void avf_adminq_init ( vlib_main_t vm,
avf_device_t ad 
)
static

Definition at line 371 of file device.c.

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

◆ avf_aq_desc_enq()

clib_error_t* avf_aq_desc_enq ( vlib_main_t vm,
avf_device_t ad,
avf_aq_desc_t dt,
void *  data,
int  len 
)

Definition at line 133 of file device.c.

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

◆ avf_arq_slot_init()

void avf_arq_slot_init ( avf_device_t ad,
u16  slot 
)

Definition at line 351 of file device.c.

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

◆ avf_clear_hw_interface_counters()

static void avf_clear_hw_interface_counters ( u32  instance)
static

Definition at line 1878 of file device.c.

+ Here is the call graph for this function:

◆ avf_cmd_rx_ctl_reg_write()

clib_error_t* avf_cmd_rx_ctl_reg_write ( vlib_main_t vm,
avf_device_t ad,
u32  reg,
u32  val 
)

Definition at line 218 of file device.c.

+ Here is the call graph for this function:

◆ avf_create_if()

void avf_create_if ( vlib_main_t vm,
avf_create_if_args_t args 
)

Definition at line 1582 of file device.c.

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

◆ avf_delete_if()

void avf_delete_if ( vlib_main_t vm,
avf_device_t ad,
int  with_barrier 
)

Definition at line 1474 of file device.c.

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

◆ avf_device_init()

clib_error_t* avf_device_init ( vlib_main_t vm,
avf_main_t am,
avf_device_t ad,
avf_create_if_args_t args 
)

Definition at line 944 of file device.c.

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

◆ avf_device_reset()

clib_error_t* avf_device_reset ( vlib_main_t vm,
avf_device_t ad 
)

Definition at line 857 of file device.c.

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

◆ avf_dma_addr()

static uword avf_dma_addr ( vlib_main_t vm,
avf_device_t ad,
void *  p 
)
inlinestatic

Definition at line 364 of file device.c.

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

◆ avf_flag_change()

static u32 avf_flag_change ( vnet_main_t vnm,
vnet_hw_interface_t hw,
u32  flags 
)
static

Definition at line 1287 of file device.c.

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

◆ avf_init()

clib_error_t* avf_init ( vlib_main_t vm)

Definition at line 1920 of file device.c.

+ Here is the call graph for this function:

◆ avf_interface_admin_up_down()

static clib_error_t* avf_interface_admin_up_down ( vnet_main_t vnm,
u32  hw_if_index,
u32  flags 
)
static

Definition at line 1784 of file device.c.

+ Here is the call graph for this function:

◆ avf_interface_rx_mode_change()

static clib_error_t* avf_interface_rx_mode_change ( vnet_main_t vnm,
u32  hw_if_index,
u32  qid,
vnet_hw_if_rx_mode  mode 
)
static

Definition at line 1808 of file device.c.

+ Here is the call graph for this function:

◆ avf_irq_0_handler()

static void avf_irq_0_handler ( vlib_main_t vm,
vlib_pci_dev_handle_t  h,
u16  line 
)
static

Definition at line 1402 of file device.c.

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

◆ avf_irq_0_set_state()

static void avf_irq_0_set_state ( avf_device_t ad,
avf_irq_state_t  state 
)
inlinestatic

Definition at line 72 of file device.c.

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

◆ avf_irq_n_handler()

static void avf_irq_n_handler ( vlib_main_t vm,
vlib_pci_dev_handle_t  h,
u16  line 
)
static

Definition at line 1439 of file device.c.

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

◆ avf_irq_n_set_state()

static void avf_irq_n_set_state ( avf_device_t ad,
u8  line,
avf_irq_state_t  state 
)
inlinestatic

Definition at line 101 of file device.c.

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

◆ avf_op_add_del_eth_addr()

clib_error_t* avf_op_add_del_eth_addr ( vlib_main_t vm,
avf_device_t ad,
u8  count,
u8 macs,
int  is_add 
)

Definition at line 751 of file device.c.

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

◆ avf_op_config_irq_map()

clib_error_t* avf_op_config_irq_map ( vlib_main_t vm,
avf_device_t ad 
)

Definition at line 720 of file device.c.

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

◆ avf_op_config_promisc_mode()

clib_error_t* avf_op_config_promisc_mode ( vlib_main_t vm,
avf_device_t ad,
int  is_enable 
)

Definition at line 644 of file device.c.

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

◆ avf_op_config_rss_key()

clib_error_t* avf_op_config_rss_key ( vlib_main_t vm,
avf_device_t ad 
)

Definition at line 611 of file device.c.

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

◆ avf_op_config_rss_lut()

clib_error_t* avf_op_config_rss_lut ( vlib_main_t vm,
avf_device_t ad 
)

Definition at line 588 of file device.c.

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

◆ avf_op_config_vsi_queues()

clib_error_t* avf_op_config_vsi_queues ( vlib_main_t vm,
avf_device_t ad 
)

Definition at line 664 of file device.c.

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

◆ avf_op_disable_vlan_stripping()

clib_error_t* avf_op_disable_vlan_stripping ( vlib_main_t vm,
avf_device_t ad 
)

Definition at line 635 of file device.c.

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

◆ avf_op_disable_vlan_stripping_v2()

clib_error_t* avf_op_disable_vlan_stripping_v2 ( vlib_main_t vm,
avf_device_t ad,
u32  outer,
u32  inner 
)

Definition at line 839 of file device.c.

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

◆ avf_op_enable_queues()

clib_error_t* avf_op_enable_queues ( vlib_main_t vm,
avf_device_t ad,
u32  rx,
u32  tx 
)

Definition at line 780 of file device.c.

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

◆ avf_op_get_offload_vlan_v2_caps()

clib_error_t* avf_op_get_offload_vlan_v2_caps ( vlib_main_t vm,
avf_device_t ad,
virtchnl_vlan_caps_t vc 
)

Definition at line 824 of file device.c.

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

◆ avf_op_get_stats()

clib_error_t* avf_op_get_stats ( vlib_main_t vm,
avf_device_t ad,
virtchnl_eth_stats_t es 
)

Definition at line 806 of file device.c.

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

◆ avf_op_get_vf_resources()

clib_error_t* avf_op_get_vf_resources ( vlib_main_t vm,
avf_device_t ad,
virtchnl_vf_resource_t res 
)

Definition at line 549 of file device.c.

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

◆ avf_op_program_flow()

clib_error_t* avf_op_program_flow ( vlib_main_t vm,
avf_device_t ad,
int  is_create,
u8 rule,
u32  rule_len,
u8 program_status,
u32  status_len 
)

Definition at line 1229 of file device.c.

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

◆ avf_op_version()

clib_error_t* avf_op_version ( vlib_main_t vm,
avf_device_t ad,
virtchnl_version_info_t ver 
)

Definition at line 527 of file device.c.

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

◆ avf_process()

static uword avf_process ( vlib_main_t vm,
vlib_node_runtime_t rt,
vlib_frame_t f 
)
static

Definition at line 1320 of file device.c.

+ Here is the call graph for this function:

◆ avf_process_handle_request()

static void avf_process_handle_request ( vlib_main_t vm,
avf_process_req_t req 
)
static

Definition at line 1243 of file device.c.

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

◆ avf_process_one_device()

void avf_process_one_device ( vlib_main_t vm,
avf_device_t ad,
int  is_irq 
)

Definition at line 1084 of file device.c.

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

◆ avf_process_request()

static clib_error_t* avf_process_request ( vlib_main_t vm,
avf_process_req_t req 
)
static

Definition at line 1264 of file device.c.

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

◆ avf_program_flow()

clib_error_t* avf_program_flow ( u32  dev_instance,
int  is_add,
u8 rule,
u32  rule_len,
u8 program_status,
u32  status_len 
)

Definition at line 1886 of file device.c.

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

◆ avf_request_queues()

clib_error_t* avf_request_queues ( vlib_main_t vm,
avf_device_t ad,
u16  num_queue_pairs 
)

Definition at line 895 of file device.c.

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

◆ avf_rxq_init()

clib_error_t* avf_rxq_init ( vlib_main_t vm,
avf_device_t ad,
u16  qid,
u16  rxq_size 
)

Definition at line 247 of file device.c.

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

◆ avf_send_to_pf()

clib_error_t* avf_send_to_pf ( vlib_main_t vm,
avf_device_t ad,
virtchnl_ops_t  op,
void *  in,
int  in_len,
void *  out,
int  out_len 
)

Definition at line 408 of file device.c.

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

◆ avf_set_interface_next_node()

static void avf_set_interface_next_node ( vnet_main_t vnm,
u32  hw_if_index,
u32  node_index 
)
static

Definition at line 1839 of file device.c.

+ Here is the call graph for this function:

◆ avf_txq_init()

clib_error_t* avf_txq_init ( vlib_main_t vm,
avf_device_t ad,
u16  qid,
u16  txq_size 
)

Definition at line 297 of file device.c.

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

◆ avf_validate_queue_size()

static u8 avf_validate_queue_size ( avf_create_if_args_t args)
static

Definition at line 1545 of file device.c.

+ Here is the caller graph for this function:

◆ VLIB_REGISTER_LOG_CLASS() [1/2]

VLIB_REGISTER_LOG_CLASS ( avf_log  )

◆ VLIB_REGISTER_LOG_CLASS() [2/2]

VLIB_REGISTER_LOG_CLASS ( avf_stats_log  )

◆ VNET_DEVICE_CLASS()

VNET_DEVICE_CLASS ( avf_device_class  )

Variable Documentation

◆ avf_main

avf_main_t avf_main

Definition at line 48 of file device.c.

◆ avf_pci_device_ids

pci_device_id_t avf_pci_device_ids[]
static
Initial value:
= {
{.vendor_id = PCI_VENDOR_ID_INTEL,.device_id = PCI_DEVICE_ID_INTEL_AVF},
{.vendor_id = PCI_VENDOR_ID_INTEL,.device_id = PCI_DEVICE_ID_INTEL_X710_VF},
{.vendor_id = PCI_VENDOR_ID_INTEL,.device_id = PCI_DEVICE_ID_INTEL_X722_VF},
{0},
}

Definition at line 51 of file device.c.

◆ avf_process_node

vlib_node_registration_t avf_process_node
Initial value:
= {
.function = avf_process,
.name = "avf-process",
}

(constructor) VLIB_REGISTER_NODE (avf_process_node)

Definition at line 1394 of file device.c.

◆ avf_tx_func_error_strings

char* avf_tx_func_error_strings[]
static
Initial value:
= {
#define _(n,s)
}

Definition at line 1871 of file device.c.

◆ virtchnl_event_names

const static char* virtchnl_event_names[]
static
Initial value:
= {
#define _(v, n)
}

Definition at line 58 of file device.c.

PCI_DEVICE_ID_INTEL_AVF
#define PCI_DEVICE_ID_INTEL_AVF
Definition: device.c:35
PCI_DEVICE_ID_INTEL_X710_VF
#define PCI_DEVICE_ID_INTEL_X710_VF
Definition: device.c:36
PCI_VENDOR_ID_INTEL
#define PCI_VENDOR_ID_INTEL
Definition: device.c:34
avf_process
static uword avf_process(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
Definition: device.c:1320
VLIB_NODE_TYPE_PROCESS
@ VLIB_NODE_TYPE_PROCESS
Definition: node.h:84
foreach_avf_tx_func_error
#define foreach_avf_tx_func_error
Definition: avf.h:478
PCI_DEVICE_ID_INTEL_X722_VF
#define PCI_DEVICE_ID_INTEL_X722_VF
Definition: device.c:37
foreach_virtchnl_event_code
@ foreach_virtchnl_event_code
Definition: virtchnl.h:213