FD.io VPP  v21.01.1
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 VIRTIO_EVENT_START_TIMER   1
 
#define VIRTIO_EVENT_STOP_TIMER   2
 
#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_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)
 
clib_error_tvirtio_set_packet_buffering (virtio_if_t *vif, u16 size)
 
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...
 
vlib_node_registration_t virtio_send_interrupt_node
 (constructor) VLIB_REGISTER_NODE (virtio_send_interrupt_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 26 of file virtio.h.

◆ foreach_virtio_if_types

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

Definition at line 45 of file virtio.h.

◆ RX_QUEUE

#define RX_QUEUE (   X)    (X*2)

Definition at line 38 of file virtio.h.

◆ RX_QUEUE_ACCESS

#define RX_QUEUE_ACCESS (   X)    (X/2)

Definition at line 40 of file virtio.h.

◆ TX_QUEUE

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

Definition at line 37 of file virtio.h.

◆ TX_QUEUE_ACCESS

#define TX_QUEUE_ACCESS (   X)    (X/2)

Definition at line 39 of file virtio.h.

◆ VIRTIO_EVENT_START_TIMER

#define VIRTIO_EVENT_START_TIMER   1

Definition at line 60 of file virtio.h.

◆ VIRTIO_EVENT_STOP_TIMER

#define VIRTIO_EVENT_STOP_TIMER   2

Definition at line 61 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:248
virtio_main_t virtio_main
Definition: virtio.c:35
vlib_log_class_t log_default
Definition: virtio.h:217

Definition at line 272 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:248
virtio_main_t virtio_main
Definition: virtio.c:35
vlib_log_class_t log_default
Definition: virtio.h:217

Definition at line 286 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:248
virtio_main_t virtio_main
Definition: virtio.c:35
vlib_log_class_t log_default
Definition: virtio.h:217

Definition at line 279 of file virtio.h.

◆ VIRTIO_NUM_RX_DESC

#define VIRTIO_NUM_RX_DESC   256

Definition at line 42 of file virtio.h.

◆ VIRTIO_NUM_TX_DESC

#define VIRTIO_NUM_TX_DESC   256

Definition at line 43 of file virtio.h.

◆ VIRTIO_RING_FLAG_MASK_INT

#define VIRTIO_RING_FLAG_MASK_INT   1

Definition at line 58 of file virtio.h.

◆ VRING_TX_OUT_OF_ORDER

#define VRING_TX_OUT_OF_ORDER   1

Definition at line 104 of file virtio.h.

Typedef Documentation

◆ virtio_pci_func_t

typedef struct _virtio_pci_func virtio_pci_func_t

Definition at line 125 of file virtio.h.

Enumeration Type Documentation

◆ virtio_if_flag_t

Enumerator
foreach_virtio_if_flag 

Definition at line 30 of file virtio.h.

◆ virtio_if_type_t

Enumerator
VIRTIO_IF_N_TYPES 

Definition at line 50 of file virtio.h.

Function Documentation

◆ virtio_free_buffers()

void virtio_free_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_kick()

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

Definition at line 251 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 405 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 252 of file virtio.c.

+ Here is the caller graph for this function:

◆ virtio_set_packet_buffering()

clib_error_t* virtio_set_packet_buffering ( virtio_if_t vif,
u16  size 
)

Definition at line 214 of file virtio.c.

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

◆ virtio_set_packet_coalesce()

void virtio_set_packet_coalesce ( virtio_if_t vif)

Definition at line 199 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 262 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 174 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 236 of file virtio.c.

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

Variable Documentation

◆ format_virtio_device_name

format_function_t format_virtio_device_name

Definition at line 247 of file virtio.h.

◆ format_virtio_log_name

format_function_t format_virtio_log_name

Definition at line 248 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 670 of file node.c.

◆ virtio_main

virtio_main_t virtio_main

Definition at line 35 of file virtio.c.

◆ virtio_send_interrupt_node

vlib_node_registration_t virtio_send_interrupt_node

(constructor) VLIB_REGISTER_NODE (virtio_send_interrupt_node)

Definition at line 75 of file virtio_process.c.