FD.io VPP  v19.08-27-gf4dcae4
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_msg
 

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 int 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_send_ctrl_msg (vlib_main_t *vm, virtio_if_t *vif, struct virtio_ctrl_msg *data, u32 len)
 
static int virtio_pci_enable_gso (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

#define PCI_CAP_ID_MSIX   0x11

Definition at line 35 of file pci.c.

#define PCI_CAP_ID_VNDR   0x09

Definition at line 34 of file pci.c.

#define PCI_CAPABILITY_LIST   0x34

Definition at line 33 of file pci.c.

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

Definition at line 39 of file pci.c.

#define PCI_DEVICE_ID_VIRTIO_NIC   0x1000

Definition at line 29 of file pci.c.

#define PCI_DEVICE_ID_VIRTIO_NIC_MODERN   0x1041

Definition at line 31 of file pci.c.

#define PCI_MSIX_ENABLE   0x8000

Definition at line 37 of file pci.c.

#define PCI_VENDOR_ID_VIRTIO   0x1af4

Definition at line 28 of file pci.c.

Function Documentation

void debug_device_config_space ( vlib_main_t vm,
virtio_if_t vif 
)
inline

Definition at line 390 of file pci.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void device_status ( vlib_main_t vm,
virtio_if_t vif 
)
inline

Definition at line 362 of file pci.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 737 of file pci.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 609 of file pci.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void virtio_pci_create_if ( vlib_main_t vm,
virtio_pci_create_if_args_t args 
)

Definition at line 1046 of file pci.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int virtio_pci_delete_if ( vlib_main_t vm,
virtio_if_t vif 
)

Definition at line 1241 of file pci.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 924 of file pci.c.

+ Here is the call graph for this function:

static int virtio_pci_enable_gso ( vlib_main_t vm,
virtio_if_t vif 
)
static

Definition at line 560 of file pci.c.

+ Here is the call graph for this function:

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

Definition at line 581 of file pci.c.

+ Here is the call graph for this function:

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

Definition at line 241 of file pci.c.

static u32 virtio_pci_get_mac ( vlib_main_t vm,
virtio_if_t vif 
)
static

Definition at line 280 of file pci.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 248 of file pci.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 306 of file pci.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 318 of file pci.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void virtio_pci_irq_handler ( vlib_main_t vm,
vlib_pci_dev_handle_t  h 
)
static

Definition at line 339 of file pci.c.

+ Here is the call graph for this function:

static u16 virtio_pci_is_link_up ( vlib_main_t vm,
virtio_if_t vif 
)
static

Definition at line 292 of file pci.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 198 of file pci.c.

+ Here is the caller graph for this function:

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:

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:

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:

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:

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

Definition at line 208 of file pci.c.

+ Here is the caller graph for this function:

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:

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:

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

Definition at line 217 of file pci.c.

+ Here is the caller graph for this function:

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:

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 228 of file pci.c.

+ Here is the caller graph for this function:

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:

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

Definition at line 181 of file pci.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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:

static u8 virtio_pci_queue_size_valid ( u16  qsz)
static

Definition at line 599 of file pci.c.

+ Here is the caller graph for this function:

clib_error_t* virtio_pci_read_caps ( vlib_main_t vm,
virtio_if_t vif 
)

Definition at line 825 of file pci.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void virtio_pci_read_device_feature ( vlib_main_t vm,
virtio_if_t vif 
)

Definition at line 786 of file pci.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int virtio_pci_reset_device ( vlib_main_t vm,
virtio_if_t vif 
)

Definition at line 792 of file pci.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 463 of file pci.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void virtio_pci_set_mac ( vlib_main_t vm,
virtio_if_t vif 
)
static

Definition at line 273 of file pci.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 662 of file pci.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

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.