FD.io VPP  v21.06-1-gbb7418cf9
Vector Packet Processing
pci.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  virtio_pci_cap_t
 
struct  virtio_pci_notify_cap_t
 
struct  virtio_pci_common_cfg_t
 
struct  virtio_net_config_t
 
struct  virtio_ctrl_msg_t
 
struct  virtio_pci_create_if_args_t
 

Macros

#define VIRTIO_PCI_ABI_VERSION   0
 
#define VIRTIO_ID_NETWORK   0x01
 
#define VIRTIO_MSI_NO_VECTOR   0xFFFF
 
#define VIRTIO_PCI_ISR_INTR   0x1
 
#define VIRTIO_PCI_ISR_CONFIG   0x2
 
#define foreach_virtio_config_status_flags
 
#define VIRTIO_NET_S_LINK_UP   1 /* Link is up */
 
#define VIRTIO_NET_S_ANNOUNCE   2 /* Announcement is needed */
 
#define VIRTIO_NET_OK   0
 
#define VIRTIO_NET_ERR   1
 
#define VIRTIO_NET_CTRL_MQ   4
 
#define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET   0
 
#define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN   1
 
#define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX   0x8000
 
#define VIRTIO_NET_CTRL_GUEST_OFFLOADS   5
 
#define VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET   0
 
#define VIRTIO_PCI_CAP_COMMON_CFG   1
 
#define VIRTIO_PCI_CAP_NOTIFY_CFG   2
 
#define VIRTIO_PCI_CAP_ISR_CFG   3
 
#define VIRTIO_PCI_CAP_DEVICE_CFG   4
 
#define VIRTIO_PCI_CAP_PCI_CFG   5
 
#define VIRTIO_PCI_QUEUE_ADDR_SHIFT   12
 
#define VIRTIO_PCI_VRING_ALIGN   4096
 
#define foreach_virtio_flags
 

Typedefs

typedef u8 virtio_net_ctrl_ack_t
 
typedef struct _virtio_pci_func virtio_pci_func_t
 

Enumerations

enum  virtio_config_status_flags_t { foreach_virtio_config_status_flags }
 
enum  virtio_msix_status_t { VIRTIO_MSIX_NONE = 0, VIRTIO_MSIX_DISABLED = 1, VIRTIO_MSIX_ENABLED = 2 }
 
enum  virtio_flag_t { foreach_virtio_flags }
 

Functions

typedef CLIB_PACKED (struct { u8 class;u8 cmd;}) virtio_net_ctrl_hdr_t
 
void device_status (vlib_main_t *vm, virtio_if_t *vif)
 
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 *ad)
 
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

const virtio_pci_func_t virtio_pci_legacy_func
 
const virtio_pci_func_t virtio_pci_modern_func
 

Macro Definition Documentation

◆ foreach_virtio_config_status_flags

#define foreach_virtio_config_status_flags
Value:
_ (VIRTIO_CONFIG_STATUS_RESET, 0x00) \
_ (VIRTIO_CONFIG_STATUS_ACK, 0x01) \
_ (VIRTIO_CONFIG_STATUS_DRIVER, 0x02) \
_ (VIRTIO_CONFIG_STATUS_DRIVER_OK, 0x04) \
_ (VIRTIO_CONFIG_STATUS_FEATURES_OK, 0x08) \
_ (VIRTIO_CONFIG_STATUS_DEVICE_NEEDS_RESET, 0x40) \
_ (VIRTIO_CONFIG_STATUS_FAILED, 0x80)

Definition at line 37 of file pci.h.

◆ foreach_virtio_flags

#define foreach_virtio_flags
Value:
_ (GSO, 0) \
_ (CSUM_OFFLOAD, 1) \
_ (GRO_COALESCE, 2) \
_ (PACKED, 3) \
_ (IN_ORDER, 4) \
_ (BUFFERING, 5)

Definition at line 215 of file pci.h.

◆ VIRTIO_ID_NETWORK

#define VIRTIO_ID_NETWORK   0x01

Definition at line 23 of file pci.h.

◆ VIRTIO_MSI_NO_VECTOR

#define VIRTIO_MSI_NO_VECTOR   0xFFFF

Definition at line 29 of file pci.h.

◆ VIRTIO_NET_CTRL_GUEST_OFFLOADS

#define VIRTIO_NET_CTRL_GUEST_OFFLOADS   5

Definition at line 74 of file pci.h.

◆ VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET

#define VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET   0

Definition at line 75 of file pci.h.

◆ VIRTIO_NET_CTRL_MQ

#define VIRTIO_NET_CTRL_MQ   4

Definition at line 61 of file pci.h.

◆ VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX

#define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX   0x8000

Definition at line 64 of file pci.h.

◆ VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN

#define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN   1

Definition at line 63 of file pci.h.

◆ VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET

#define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET   0

Definition at line 62 of file pci.h.

◆ VIRTIO_NET_ERR

#define VIRTIO_NET_ERR   1

Definition at line 58 of file pci.h.

◆ VIRTIO_NET_OK

#define VIRTIO_NET_OK   0

Definition at line 57 of file pci.h.

◆ VIRTIO_NET_S_ANNOUNCE

#define VIRTIO_NET_S_ANNOUNCE   2 /* Announcement is needed */

Definition at line 55 of file pci.h.

◆ VIRTIO_NET_S_LINK_UP

#define VIRTIO_NET_S_LINK_UP   1 /* Link is up */

Definition at line 54 of file pci.h.

◆ VIRTIO_PCI_ABI_VERSION

#define VIRTIO_PCI_ABI_VERSION   0

Definition at line 20 of file pci.h.

◆ VIRTIO_PCI_CAP_COMMON_CFG

#define VIRTIO_PCI_CAP_COMMON_CFG   1

Definition at line 78 of file pci.h.

◆ VIRTIO_PCI_CAP_DEVICE_CFG

#define VIRTIO_PCI_CAP_DEVICE_CFG   4

Definition at line 84 of file pci.h.

◆ VIRTIO_PCI_CAP_ISR_CFG

#define VIRTIO_PCI_CAP_ISR_CFG   3

Definition at line 82 of file pci.h.

◆ VIRTIO_PCI_CAP_NOTIFY_CFG

#define VIRTIO_PCI_CAP_NOTIFY_CFG   2

Definition at line 80 of file pci.h.

◆ VIRTIO_PCI_CAP_PCI_CFG

#define VIRTIO_PCI_CAP_PCI_CFG   5

Definition at line 86 of file pci.h.

◆ VIRTIO_PCI_ISR_CONFIG

#define VIRTIO_PCI_ISR_CONFIG   0x2

Definition at line 34 of file pci.h.

◆ VIRTIO_PCI_ISR_INTR

#define VIRTIO_PCI_ISR_INTR   0x1

Definition at line 32 of file pci.h.

◆ VIRTIO_PCI_QUEUE_ADDR_SHIFT

#define VIRTIO_PCI_QUEUE_ADDR_SHIFT   12

Definition at line 88 of file pci.h.

◆ VIRTIO_PCI_VRING_ALIGN

#define VIRTIO_PCI_VRING_ALIGN   4096

Definition at line 90 of file pci.h.

Typedef Documentation

◆ virtio_net_ctrl_ack_t

Definition at line 165 of file pci.h.

◆ virtio_pci_func_t

typedef struct _virtio_pci_func virtio_pci_func_t

Enumeration Type Documentation

◆ virtio_config_status_flags_t

Enumerator
foreach_virtio_config_status_flags 

Definition at line 46 of file pci.h.

◆ virtio_flag_t

Enumerator
foreach_virtio_flags 

Definition at line 223 of file pci.h.

◆ virtio_msix_status_t

Enumerator
VIRTIO_MSIX_NONE 
VIRTIO_MSIX_DISABLED 
VIRTIO_MSIX_ENABLED 

Definition at line 92 of file pci.h.

Function Documentation

◆ CLIB_PACKED()

typedef CLIB_PACKED ( struct { u8 class;u8 cmd;}  )

◆ 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_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 ad 
)

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_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:

Variable Documentation

◆ virtio_pci_legacy_func

const virtio_pci_func_t virtio_pci_legacy_func

Definition at line 360 of file virtio_pci_legacy.c.

◆ virtio_pci_modern_func

const virtio_pci_func_t virtio_pci_modern_func

Definition at line 420 of file virtio_pci_modern.c.