FD.io VPP  v20.09-64-g4f7b92f0a
Vector Packet Processing
virtio.h File Reference
+ Include dependency graph for virtio.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  virtio_vring_t
 
union  pci_addr_t
 
struct  virtio_if_t
 
struct  virtio_main_t
 

Macros

#define foreach_virtio_if_flag
 
#define TX_QUEUE(X)   ((X*2) + 1)
 
#define RX_QUEUE(X)   (X*2)
 
#define TX_QUEUE_ACCESS(X)   (X/2)
 
#define RX_QUEUE_ACCESS(X)   (X/2)
 
#define VIRTIO_NUM_RX_DESC   256
 
#define VIRTIO_NUM_TX_DESC   256
 
#define foreach_virtio_if_types
 
#define VIRTIO_RING_FLAG_MASK_INT   1
 
#define VRING_TX_OUT_OF_ORDER   1
 
#define virtio_log_debug(vif, f, ...)
 
#define virtio_log_warning(vif, f, ...)
 
#define virtio_log_error(vif, f, ...)
 

Typedefs

typedef struct _virtio_pci_func virtio_pci_func_t
 

Enumerations

enum  virtio_if_flag_t { foreach_virtio_if_flag }
 
enum  virtio_if_type_t { VIRTIO_IF_N_TYPES = (1 << 3) }
 

Functions

clib_error_tvirtio_vring_init (vlib_main_t *vm, virtio_if_t *vif, u16 idx, u16 sz)
 
clib_error_tvirtio_vring_free_rx (vlib_main_t *vm, virtio_if_t *vif, u32 idx)
 
clib_error_tvirtio_vring_free_tx (vlib_main_t *vm, virtio_if_t *vif, u32 idx)
 
void virtio_vring_set_numa_node (vlib_main_t *vm, virtio_if_t *vif, u32 idx)
 
void virtio_free_used_desc (vlib_main_t *vm, virtio_vring_t *vring)
 
void virtio_free_rx_buffers (vlib_main_t *vm, virtio_vring_t *vring)
 
void virtio_set_net_hdr_size (virtio_if_t *vif)
 
void virtio_show (vlib_main_t *vm, u32 *hw_if_indices, u8 show_descr, u32 type)
 
void virtio_set_packet_coalesce (virtio_if_t *vif)
 
void virtio_pci_legacy_notify_queue (vlib_main_t *vm, virtio_if_t *vif, u16 queue_id, u16 queue_notify_offset)
 
void virtio_pci_modern_notify_queue (vlib_main_t *vm, virtio_if_t *vif, u16 queue_id, u16 queue_notify_offset)
 
static_always_inline void virtio_kick (vlib_main_t *vm, virtio_vring_t *vring, virtio_if_t *vif)
 

Variables

virtio_main_t virtio_main
 
vnet_device_class_t virtio_device_class
 
vlib_node_registration_t virtio_input_node
 (constructor) VLIB_REGISTER_NODE (virtio_input_node) More...
 
format_function_t format_virtio_device_name
 
format_function_t format_virtio_log_name
 

Macro Definition Documentation

◆ foreach_virtio_if_flag

#define foreach_virtio_if_flag
Value:
_(0, ADMIN_UP, "admin-up") \
_(1, DELETING, "deleting")

Definition at line 25 of file virtio.h.

◆ foreach_virtio_if_types

#define foreach_virtio_if_types
Value:
_ (TAP, 0) \
_ (TUN, 1) \
_ (PCI, 2)

Definition at line 44 of file virtio.h.

◆ RX_QUEUE

#define RX_QUEUE (   X)    (X*2)

Definition at line 37 of file virtio.h.

◆ RX_QUEUE_ACCESS

#define RX_QUEUE_ACCESS (   X)    (X/2)

Definition at line 39 of file virtio.h.

◆ TX_QUEUE

#define TX_QUEUE (   X)    ((X*2) + 1)

Definition at line 36 of file virtio.h.

◆ TX_QUEUE_ACCESS

#define TX_QUEUE_ACCESS (   X)    (X/2)

Definition at line 38 of file virtio.h.

◆ virtio_log_debug

#define virtio_log_debug (   vif,
  f,
  ... 
)
Value:
{ \
vlib_log(VLIB_LOG_LEVEL_DEBUG, virtio_main.log_default, \
"%U: " f, format_virtio_log_name, vif, \
##__VA_ARGS__); \
};
format_function_t format_virtio_log_name
Definition: virtio.h:220
virtio_main_t virtio_main
Definition: virtio.c:35
vlib_log_class_t log_default
Definition: virtio.h:190

Definition at line 244 of file virtio.h.

◆ virtio_log_error

#define virtio_log_error (   vif,
  f,
  ... 
)
Value:
{ \
vlib_log(VLIB_LOG_LEVEL_ERR, virtio_main.log_default, \
"%U: " f, format_virtio_log_name, vif, \
##__VA_ARGS__); \
};
format_function_t format_virtio_log_name
Definition: virtio.h:220
virtio_main_t virtio_main
Definition: virtio.c:35
vlib_log_class_t log_default
Definition: virtio.h:190

Definition at line 258 of file virtio.h.

◆ virtio_log_warning

#define virtio_log_warning (   vif,
  f,
  ... 
)
Value:
{ \
vlib_log(VLIB_LOG_LEVEL_WARNING, virtio_main.log_default, \
"%U: " f, format_virtio_log_name, vif, \
##__VA_ARGS__); \
};
format_function_t format_virtio_log_name
Definition: virtio.h:220
virtio_main_t virtio_main
Definition: virtio.c:35
vlib_log_class_t log_default
Definition: virtio.h:190

Definition at line 251 of file virtio.h.

◆ VIRTIO_NUM_RX_DESC

#define VIRTIO_NUM_RX_DESC   256

Definition at line 41 of file virtio.h.

◆ VIRTIO_NUM_TX_DESC

#define VIRTIO_NUM_TX_DESC   256

Definition at line 42 of file virtio.h.

◆ VIRTIO_RING_FLAG_MASK_INT

#define VIRTIO_RING_FLAG_MASK_INT   1

Definition at line 57 of file virtio.h.

◆ VRING_TX_OUT_OF_ORDER

#define VRING_TX_OUT_OF_ORDER   1

Definition at line 80 of file virtio.h.

Typedef Documentation

◆ virtio_pci_func_t

typedef struct _virtio_pci_func virtio_pci_func_t

Definition at line 102 of file virtio.h.

Enumeration Type Documentation

◆ virtio_if_flag_t

Enumerator
foreach_virtio_if_flag 

Definition at line 29 of file virtio.h.

◆ virtio_if_type_t

Enumerator
VIRTIO_IF_N_TYPES 

Definition at line 49 of file virtio.h.

Function Documentation

◆ virtio_free_rx_buffers()

void virtio_free_rx_buffers ( vlib_main_t vm,
virtio_vring_t vring 
)
inline

Definition at line 137 of file virtio.c.

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

◆ virtio_free_used_desc()

void virtio_free_used_desc ( vlib_main_t vm,
virtio_vring_t vring 
)
inline

Definition at line 174 of file virtio.c.

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

◆ virtio_kick()

static_always_inline void virtio_kick ( vlib_main_t vm,
virtio_vring_t vring,
virtio_if_t vif 
)

Definition at line 223 of file virtio.h.

+ Here is the call graph for this function:
+ 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,
u16  queue_notify_offset 
)
inline

Definition at line 214 of file virtio_pci_legacy.c.

+ Here is the caller graph for this function:

◆ virtio_pci_modern_notify_queue()

void virtio_pci_modern_notify_queue ( vlib_main_t vm,
virtio_if_t vif,
u16  queue_id,
u16  queue_notify_offset 
)
inline

Definition at line 390 of file virtio_pci_modern.c.

+ Here is the caller graph for this function:

◆ virtio_set_net_hdr_size()

void virtio_set_net_hdr_size ( virtio_if_t vif)
inline

Definition at line 255 of file virtio.c.

+ Here is the caller graph for this function:

◆ virtio_set_packet_coalesce()

void virtio_set_packet_coalesce ( virtio_if_t vif)

Definition at line 224 of file virtio.c.

+ Here is the call graph for this function:

◆ virtio_show()

void virtio_show ( vlib_main_t vm,
u32 hw_if_indices,
u8  show_descr,
u32  type 
)
inline

Definition at line 265 of file virtio.c.

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

◆ virtio_vring_free_rx()

clib_error_t* virtio_vring_free_rx ( vlib_main_t vm,
virtio_if_t vif,
u32  idx 
)

Definition at line 152 of file virtio.c.

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

◆ virtio_vring_free_tx()

clib_error_t* virtio_vring_free_tx ( vlib_main_t vm,
virtio_if_t vif,
u32  idx 
)

Definition at line 200 of file virtio.c.

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

◆ virtio_vring_init()

clib_error_t* virtio_vring_init ( vlib_main_t vm,
virtio_if_t vif,
u16  idx,
u16  sz 
)

Definition at line 64 of file virtio.c.

+ Here is the call graph for this function:

◆ virtio_vring_set_numa_node()

void virtio_vring_set_numa_node ( vlib_main_t vm,
virtio_if_t vif,
u32  idx 
)

Definition at line 239 of file virtio.c.

+ Here is the call graph for this function:

Variable Documentation

◆ format_virtio_device_name

format_function_t format_virtio_device_name

Definition at line 219 of file virtio.h.

◆ format_virtio_log_name

format_function_t format_virtio_log_name

Definition at line 220 of file virtio.h.

◆ virtio_device_class

vnet_device_class_t virtio_device_class

◆ virtio_input_node

vlib_node_registration_t virtio_input_node

(constructor) VLIB_REGISTER_NODE (virtio_input_node)

Definition at line 490 of file node.c.

◆ virtio_main

virtio_main_t virtio_main

Definition at line 35 of file virtio.c.