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

Go to the source code of this file.

Macros

#define PCI_VENDOR_ID_VIRTIO   0x1af4
 
#define PCI_DEVICE_ID_VIRTIO_NIC   0x1000
 
#define PCI_DEVICE_ID_VIRTIO_NIC_MODERN   0x1041
 
#define PCI_CAPABILITY_LIST   0x34
 
#define PCI_CAP_ID_VNDR   0x09
 
#define PCI_CAP_ID_MSIX   0x11
 
#define PCI_MSIX_ENABLE   0x8000
 

Functions

static u32 virtio_pci_flag_change (vnet_main_t *vnm, vnet_hw_interface_t *hw, u32 flags)
 
static clib_error_tvirtio_pci_get_max_virtqueue_pairs (vlib_main_t *vm, virtio_if_t *vif)
 
static void virtio_pci_set_mac (vlib_main_t *vm, virtio_if_t *vif)
 
static u32 virtio_pci_get_mac (vlib_main_t *vm, virtio_if_t *vif)
 
static u16 virtio_pci_is_link_up (vlib_main_t *vm, virtio_if_t *vif)
 
static void virtio_pci_irq_queue_handler (vlib_main_t *vm, vlib_pci_dev_handle_t h, u16 line)
 
static void virtio_pci_irq_config_handler (vlib_main_t *vm, vlib_pci_dev_handle_t h, u16 line)
 
static void virtio_pci_irq_handler (vlib_main_t *vm, vlib_pci_dev_handle_t h)
 
void device_status (vlib_main_t *vm, virtio_if_t *vif)
 
static int virtio_pci_send_ctrl_msg_packed (vlib_main_t *vm, virtio_if_t *vif, virtio_ctrl_msg_t *data, u32 len)
 
static int virtio_pci_send_ctrl_msg_split (vlib_main_t *vm, virtio_if_t *vif, virtio_ctrl_msg_t *data, u32 len)
 
static int virtio_pci_send_ctrl_msg (vlib_main_t *vm, virtio_if_t *vif, virtio_ctrl_msg_t *data, u32 len)
 
static int virtio_pci_disable_offload (vlib_main_t *vm, virtio_if_t *vif)
 
static int virtio_pci_enable_checksum_offload (vlib_main_t *vm, virtio_if_t *vif)
 
static int virtio_pci_enable_gso (vlib_main_t *vm, virtio_if_t *vif)
 
static int virtio_pci_offloads (vlib_main_t *vm, virtio_if_t *vif, int gso_enabled, int csum_offload_enabled)
 
static int virtio_pci_enable_multiqueue (vlib_main_t *vm, virtio_if_t *vif, u16 num_queues)
 
static u8 virtio_pci_queue_size_valid (u16 qsz)
 
clib_error_tvirtio_pci_control_vring_packed_init (vlib_main_t *vm, virtio_if_t *vif, u16 queue_num)
 
clib_error_tvirtio_pci_control_vring_split_init (vlib_main_t *vm, virtio_if_t *vif, u16 queue_num)
 
clib_error_tvirtio_pci_control_vring_init (vlib_main_t *vm, virtio_if_t *vif, u16 queue_num)
 
clib_error_tvirtio_pci_vring_split_init (vlib_main_t *vm, virtio_if_t *vif, u16 queue_num)
 
clib_error_tvirtio_pci_vring_packed_init (vlib_main_t *vm, virtio_if_t *vif, u16 queue_num)
 
clib_error_tvirtio_pci_vring_init (vlib_main_t *vm, virtio_if_t *vif, u16 queue_num)
 
static void virtio_negotiate_features (vlib_main_t *vm, virtio_if_t *vif, u64 req_features)
 
void virtio_pci_read_device_feature (vlib_main_t *vm, virtio_if_t *vif)
 
int virtio_pci_reset_device (vlib_main_t *vm, virtio_if_t *vif)
 
clib_error_tvirtio_pci_read_caps (vlib_main_t *vm, virtio_if_t *vif, void **bar)
 
static clib_error_tvirtio_pci_device_init (vlib_main_t *vm, virtio_if_t *vif, virtio_pci_create_if_args_t *args, void **bar)
 
void virtio_pci_create_if (vlib_main_t *vm, virtio_pci_create_if_args_t *args)
 
int virtio_pci_delete_if (vlib_main_t *vm, virtio_if_t *vif)
 
int virtio_pci_enable_disable_offloads (vlib_main_t *vm, virtio_if_t *vif, int gso_enabled, int checksum_offload_enabled, int offloads_disabled)
 

Variables

static pci_device_id_t virtio_pci_device_ids []
 

Macro Definition Documentation

◆ PCI_CAP_ID_MSIX

#define PCI_CAP_ID_MSIX   0x11

Definition at line 36 of file pci.c.

◆ PCI_CAP_ID_VNDR

#define PCI_CAP_ID_VNDR   0x09

Definition at line 35 of file pci.c.

◆ PCI_CAPABILITY_LIST

#define PCI_CAPABILITY_LIST   0x34

Definition at line 34 of file pci.c.

◆ PCI_DEVICE_ID_VIRTIO_NIC

#define PCI_DEVICE_ID_VIRTIO_NIC   0x1000

Definition at line 30 of file pci.c.

◆ PCI_DEVICE_ID_VIRTIO_NIC_MODERN

#define PCI_DEVICE_ID_VIRTIO_NIC_MODERN   0x1041

Definition at line 32 of file pci.c.

◆ PCI_MSIX_ENABLE

#define PCI_MSIX_ENABLE   0x8000

Definition at line 38 of file pci.c.

◆ PCI_VENDOR_ID_VIRTIO

#define PCI_VENDOR_ID_VIRTIO   0x1af4

Definition at line 29 of file pci.c.

Function Documentation

◆ device_status()

void device_status ( vlib_main_t vm,
virtio_if_t vif 
)
inline

Definition at line 172 of file pci.c.

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

◆ virtio_negotiate_features()

static void virtio_negotiate_features ( vlib_main_t vm,
virtio_if_t vif,
u64  req_features 
)
static

Definition at line 907 of file pci.c.

+ Here is the caller graph for this function:

◆ virtio_pci_control_vring_init()

clib_error_t* virtio_pci_control_vring_init ( vlib_main_t vm,
virtio_if_t vif,
u16  queue_num 
)

Definition at line 717 of file pci.c.

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

◆ virtio_pci_control_vring_packed_init()

clib_error_t* virtio_pci_control_vring_packed_init ( vlib_main_t vm,
virtio_if_t vif,
u16  queue_num 
)

Definition at line 596 of file pci.c.

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

◆ virtio_pci_control_vring_split_init()

clib_error_t* virtio_pci_control_vring_split_init ( vlib_main_t vm,
virtio_if_t vif,
u16  queue_num 
)

Definition at line 661 of file pci.c.

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

◆ virtio_pci_create_if()

void virtio_pci_create_if ( vlib_main_t vm,
virtio_pci_create_if_args_t args 
)

Definition at line 1348 of file pci.c.

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

◆ virtio_pci_delete_if()

int virtio_pci_delete_if ( vlib_main_t vm,
virtio_if_t vif 
)

Definition at line 1548 of file pci.c.

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

◆ virtio_pci_device_init()

static clib_error_t* virtio_pci_device_init ( vlib_main_t vm,
virtio_if_t vif,
virtio_pci_create_if_args_t args,
void **  bar 
)
static

Definition at line 1146 of file pci.c.

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

◆ virtio_pci_disable_offload()

static int virtio_pci_disable_offload ( vlib_main_t vm,
virtio_if_t vif 
)
static

Definition at line 445 of file pci.c.

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

◆ virtio_pci_enable_checksum_offload()

static int virtio_pci_enable_checksum_offload ( vlib_main_t vm,
virtio_if_t vif 
)
static

Definition at line 465 of file pci.c.

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

◆ virtio_pci_enable_disable_offloads()

int virtio_pci_enable_disable_offloads ( vlib_main_t vm,
virtio_if_t vif,
int  gso_enabled,
int  checksum_offload_enabled,
int  offloads_disabled 
)

Definition at line 1630 of file pci.c.

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

◆ virtio_pci_enable_gso()

static int virtio_pci_enable_gso ( vlib_main_t vm,
virtio_if_t vif 
)
static

Definition at line 486 of file pci.c.

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

◆ virtio_pci_enable_multiqueue()

static int virtio_pci_enable_multiqueue ( vlib_main_t vm,
virtio_if_t vif,
u16  num_queues 
)
static

Definition at line 569 of file pci.c.

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

◆ virtio_pci_flag_change()

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

Definition at line 51 of file pci.c.

+ Here is the caller graph for this function:

◆ virtio_pci_get_mac()

static u32 virtio_pci_get_mac ( vlib_main_t vm,
virtio_if_t vif 
)
static

Definition at line 86 of file pci.c.

+ Here is the caller graph for this function:

◆ virtio_pci_get_max_virtqueue_pairs()

static clib_error_t* virtio_pci_get_max_virtqueue_pairs ( vlib_main_t vm,
virtio_if_t vif 
)
static

Definition at line 58 of file pci.c.

+ Here is the caller graph for this function:

◆ virtio_pci_irq_config_handler()

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

Definition at line 124 of file pci.c.

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

◆ virtio_pci_irq_handler()

static void virtio_pci_irq_handler ( vlib_main_t vm,
vlib_pci_dev_handle_t  h 
)
static

Definition at line 146 of file pci.c.

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

◆ virtio_pci_irq_queue_handler()

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

Definition at line 109 of file pci.c.

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

◆ virtio_pci_is_link_up()

static u16 virtio_pci_is_link_up ( vlib_main_t vm,
virtio_if_t vif 
)
static

Definition at line 97 of file pci.c.

+ Here is the caller graph for this function:

◆ virtio_pci_offloads()

static int virtio_pci_offloads ( vlib_main_t vm,
virtio_if_t vif,
int  gso_enabled,
int  csum_offload_enabled 
)
static

Definition at line 507 of file pci.c.

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

◆ virtio_pci_queue_size_valid()

static u8 virtio_pci_queue_size_valid ( u16  qsz)
static

Definition at line 586 of file pci.c.

+ Here is the caller graph for this function:

◆ virtio_pci_read_caps()

clib_error_t* virtio_pci_read_caps ( vlib_main_t vm,
virtio_if_t vif,
void **  bar 
)

Definition at line 1007 of file pci.c.

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

◆ virtio_pci_read_device_feature()

void virtio_pci_read_device_feature ( vlib_main_t vm,
virtio_if_t vif 
)

Definition at line 968 of file pci.c.

+ Here is the caller graph for this function:

◆ virtio_pci_reset_device()

int virtio_pci_reset_device ( vlib_main_t vm,
virtio_if_t vif 
)

Definition at line 974 of file pci.c.

+ Here is the caller graph for this function:

◆ virtio_pci_send_ctrl_msg()

static int virtio_pci_send_ctrl_msg ( vlib_main_t vm,
virtio_if_t vif,
virtio_ctrl_msg_t data,
u32  len 
)
static

Definition at line 435 of file pci.c.

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

◆ virtio_pci_send_ctrl_msg_packed()

static int virtio_pci_send_ctrl_msg_packed ( vlib_main_t vm,
virtio_if_t vif,
virtio_ctrl_msg_t data,
u32  len 
)
static

Definition at line 200 of file pci.c.

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

◆ virtio_pci_send_ctrl_msg_split()

static int virtio_pci_send_ctrl_msg_split ( vlib_main_t vm,
virtio_if_t vif,
virtio_ctrl_msg_t data,
u32  len 
)
static

Definition at line 340 of file pci.c.

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

◆ virtio_pci_set_mac()

static void virtio_pci_set_mac ( vlib_main_t vm,
virtio_if_t vif 
)
static

Definition at line 79 of file pci.c.

+ Here is the caller graph for this function:

◆ virtio_pci_vring_init()

clib_error_t* virtio_pci_vring_init ( vlib_main_t vm,
virtio_if_t vif,
u16  queue_num 
)

Definition at line 898 of file pci.c.

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

◆ virtio_pci_vring_packed_init()

clib_error_t* virtio_pci_vring_packed_init ( vlib_main_t vm,
virtio_if_t vif,
u16  queue_num 
)

Definition at line 807 of file pci.c.

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

◆ virtio_pci_vring_split_init()

clib_error_t* virtio_pci_vring_split_init ( vlib_main_t vm,
virtio_if_t vif,
u16  queue_num 
)

Definition at line 727 of file pci.c.

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

Variable Documentation

◆ virtio_pci_device_ids

pci_device_id_t virtio_pci_device_ids[]
static
Initial value:
= {
{
.vendor_id = PCI_VENDOR_ID_VIRTIO,
.device_id = PCI_DEVICE_ID_VIRTIO_NIC},
{
.vendor_id = PCI_VENDOR_ID_VIRTIO,
{0},
}

Definition at line 40 of file pci.c.

PCI_DEVICE_ID_VIRTIO_NIC_MODERN
#define PCI_DEVICE_ID_VIRTIO_NIC_MODERN
Definition: pci.c:32
PCI_DEVICE_ID_VIRTIO_NIC
#define PCI_DEVICE_ID_VIRTIO_NIC
Definition: pci.c:30
PCI_VENDOR_ID_VIRTIO
#define PCI_VENDOR_ID_VIRTIO
Definition: pci.c:29