FD.io VPP  v19.04.4-rc0-5-ge88582fac
Vector Packet Processing
pci.c File Reference
+ Include dependency graph for pci.c:

Go to the source code of this file.

Data Structures

struct  virtio_ctrl_mq_status_hdr
 

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
 
#define PCI_CONFIG_SIZE(vif)
 

Functions

static void virtio_pci_legacy_read_config (vlib_main_t *vm, virtio_if_t *vif, void *dst, int len, u32 addr)
 
static void virtio_pci_legacy_write_config (vlib_main_t *vm, virtio_if_t *vif, void *src, int len, u32 addr)
 
static u64 virtio_pci_legacy_get_features (vlib_main_t *vm, virtio_if_t *vif)
 
static u32 virtio_pci_legacy_set_features (vlib_main_t *vm, virtio_if_t *vif, u64 features)
 
static u8 virtio_pci_legacy_get_status (vlib_main_t *vm, virtio_if_t *vif)
 
static void virtio_pci_legacy_set_status (vlib_main_t *vm, virtio_if_t *vif, u8 status)
 
static u8 virtio_pci_legacy_reset (vlib_main_t *vm, virtio_if_t *vif)
 
static u8 virtio_pci_legacy_get_isr (vlib_main_t *vm, virtio_if_t *vif)
 
static u16 virtio_pci_legacy_get_queue_num (vlib_main_t *vm, virtio_if_t *vif, u16 queue_id)
 
static void virtio_pci_legacy_setup_queue (vlib_main_t *vm, virtio_if_t *vif, u16 queue_id, void *p)
 
static void virtio_pci_legacy_del_queue (vlib_main_t *vm, virtio_if_t *vif, u16 queue_id)
 
void virtio_pci_legacy_notify_queue (vlib_main_t *vm, virtio_if_t *vif, u16 queue_id)
 
static u16 virtio_pci_legacy_set_config_irq (vlib_main_t *vm, virtio_if_t *vif, u16 vec)
 
static u16 virtio_pci_legacy_set_queue_irq (vlib_main_t *vm, virtio_if_t *vif, u16 vec, u16 queue_id)
 
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_0_handler (vlib_main_t *vm, vlib_pci_dev_handle_t h, u16 line)
 
static void virtio_pci_irq_1_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)
 
void debug_device_config_space (vlib_main_t *vm, virtio_if_t *vif)
 
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)
 
static clib_error_tvirtio_pci_device_init (vlib_main_t *vm, virtio_if_t *vif, virtio_pci_create_if_args_t *args)
 
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)
 

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_CONFIG_SIZE

#define PCI_CONFIG_SIZE (   vif)
Value:
((vif->msix_enabled == VIRTIO_MSIX_ENABLED) ? \
24 : 20)

Definition at line 39 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

◆ debug_device_config_space()

void debug_device_config_space ( vlib_main_t vm,
virtio_if_t vif 
)
inline

Definition at line 385 of file pci.c.

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

◆ device_status()

void device_status ( vlib_main_t vm,
virtio_if_t vif 
)
inline

Definition at line 357 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 702 of file pci.c.

+ Here is the call graph for this function:
+ 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 573 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 989 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 1186 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 
)
static

Definition at line 879 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 458 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 236 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 275 of file pci.c.

+ Here is the call graph for this function:
+ 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 243 of file pci.c.

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

◆ virtio_pci_irq_0_handler()

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

Definition at line 301 of file pci.c.

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

◆ virtio_pci_irq_1_handler()

static void virtio_pci_irq_1_handler ( vlib_main_t vm,
vlib_pci_dev_handle_t  h,
u16  line 
)
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_irq_handler()

static void virtio_pci_irq_handler ( vlib_main_t vm,
vlib_pci_dev_handle_t  h 
)
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_is_link_up()

static u16 virtio_pci_is_link_up ( vlib_main_t vm,
virtio_if_t vif 
)
static

Definition at line 287 of file pci.c.

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

◆ virtio_pci_legacy_del_queue()

static void virtio_pci_legacy_del_queue ( vlib_main_t vm,
virtio_if_t vif,
u16  queue_id 
)
static

Definition at line 193 of file pci.c.

+ Here is the caller graph for this function:

◆ virtio_pci_legacy_get_features()

static u64 virtio_pci_legacy_get_features ( vlib_main_t vm,
virtio_if_t vif 
)
static

Definition at line 113 of file pci.c.

+ Here is the caller graph for this function:

◆ virtio_pci_legacy_get_isr()

static u8 virtio_pci_legacy_get_isr ( vlib_main_t vm,
virtio_if_t vif 
)
static

Definition at line 161 of file pci.c.

+ Here is the caller graph for this function:

◆ virtio_pci_legacy_get_queue_num()

static u16 virtio_pci_legacy_get_queue_num ( vlib_main_t vm,
virtio_if_t vif,
u16  queue_id 
)
static

Definition at line 169 of file pci.c.

+ Here is the caller graph for this function:

◆ virtio_pci_legacy_get_status()

static u8 virtio_pci_legacy_get_status ( vlib_main_t vm,
virtio_if_t vif 
)
static

Definition at line 138 of file pci.c.

+ Here is the caller graph for this function:

◆ virtio_pci_legacy_notify_queue()

void virtio_pci_legacy_notify_queue ( vlib_main_t vm,
virtio_if_t vif,
u16  queue_id 
)
inline

Definition at line 203 of file pci.c.

+ Here is the caller graph for this function:

◆ virtio_pci_legacy_read_config()

static void virtio_pci_legacy_read_config ( vlib_main_t vm,
virtio_if_t vif,
void *  dst,
int  len,
u32  addr 
)
static

Definition at line 53 of file pci.c.

+ Here is the caller graph for this function:

◆ virtio_pci_legacy_reset()

static u8 virtio_pci_legacy_reset ( vlib_main_t vm,
virtio_if_t vif 
)
static

Definition at line 154 of file pci.c.

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

◆ virtio_pci_legacy_set_config_irq()

static u16 virtio_pci_legacy_set_config_irq ( vlib_main_t vm,
virtio_if_t vif,
u16  vec 
)
static

Definition at line 212 of file pci.c.

+ Here is the caller graph for this function:

◆ virtio_pci_legacy_set_features()

static u32 virtio_pci_legacy_set_features ( vlib_main_t vm,
virtio_if_t vif,
u64  features 
)
static

Definition at line 122 of file pci.c.

+ Here is the caller graph for this function:

◆ virtio_pci_legacy_set_queue_irq()

static u16 virtio_pci_legacy_set_queue_irq ( vlib_main_t vm,
virtio_if_t vif,
u16  vec,
u16  queue_id 
)
static

Definition at line 223 of file pci.c.

+ Here is the caller graph for this function:

◆ virtio_pci_legacy_set_status()

static void virtio_pci_legacy_set_status ( vlib_main_t vm,
virtio_if_t vif,
u8  status 
)
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_legacy_setup_queue()

static void virtio_pci_legacy_setup_queue ( vlib_main_t vm,
virtio_if_t vif,
u16  queue_id,
void *  p 
)
static

Definition at line 182 of file pci.c.

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

◆ virtio_pci_legacy_write_config()

static void virtio_pci_legacy_write_config ( vlib_main_t vm,
virtio_if_t vif,
void *  src,
int  len,
u32  addr 
)
static

Definition at line 83 of file pci.c.

+ 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 563 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 
)

Definition at line 780 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 741 of file pci.c.

+ Here is the call graph for this function:
+ 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 747 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 268 of file pci.c.

+ Here is the call graph for this function:
+ 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 626 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 42 of file pci.c.