FD.io VPP  v20.09-64-g4f7b92f0a
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 (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_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 35 of file pci.c.

◆ PCI_CAP_ID_VNDR

#define PCI_CAP_ID_VNDR   0x09

Definition at line 34 of file pci.c.

◆ PCI_CAPABILITY_LIST

#define PCI_CAPABILITY_LIST   0x34

Definition at line 33 of file pci.c.

◆ PCI_DEVICE_ID_VIRTIO_NIC

#define PCI_DEVICE_ID_VIRTIO_NIC   0x1000

Definition at line 29 of file pci.c.

◆ PCI_DEVICE_ID_VIRTIO_NIC_MODERN

#define PCI_DEVICE_ID_VIRTIO_NIC_MODERN   0x1041

Definition at line 31 of file pci.c.

◆ PCI_MSIX_ENABLE

#define PCI_MSIX_ENABLE   0x8000

Definition at line 37 of file pci.c.

◆ PCI_VENDOR_ID_VIRTIO

#define PCI_VENDOR_ID_VIRTIO   0x1af4

Definition at line 28 of file pci.c.

Function Documentation

◆ device_status()

void device_status ( vlib_main_t vm,
virtio_if_t vif 
)
inline

Definition at line 170 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 578 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 443 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 1009 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 1210 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 807 of file pci.c.

+ Here is the call 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 293 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 313 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 1294 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 334 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 416 of file pci.c.

+ Here is the call 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 50 of file pci.c.

◆ virtio_pci_get_mac()

static u32 virtio_pci_get_mac ( vlib_main_t vm,
virtio_if_t vif 
)
static

Definition at line 85 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 57 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 122 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 144 of file pci.c.

+ Here is the call 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 108 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 96 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 355 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 433 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 668 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 629 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 635 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 198 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 78 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 499 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},
}
#define PCI_DEVICE_ID_VIRTIO_NIC
Definition: pci.c:29
#define PCI_DEVICE_ID_VIRTIO_NIC_MODERN
Definition: pci.c:31
#define PCI_VENDOR_ID_VIRTIO
Definition: pci.c:28

Definition at line 39 of file pci.c.