FD.io VPP  v21.01.1
Vector Packet Processing
device.c File Reference
+ Include dependency graph for device.c:

Go to the source code of this file.

Data Structures

struct  virtio_tx_trace_t
 

Macros

#define foreach_virtio_tx_func_error
 

Enumerations

enum  virtio_tx_func_error_t { VIRTIO_TX_N_ERROR }
 

Functions

static u8format_virtio_device (u8 *s, va_list *args)
 
static u8format_virtio_tx_trace (u8 *s, va_list *va)
 
static_always_inline void virtio_tx_trace (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_buffer_t *b0, u32 bi, int is_tun)
 
static_always_inline void virtio_interface_drop_inline (vlib_main_t *vm, uword node_index, u32 *buffers, u16 n, virtio_tx_func_error_t error)
 
static_always_inline void virtio_memset_ring_u32 (u32 *ring, u32 start, u32 ring_size, u32 n_buffers)
 
static_always_inline void virtio_free_used_device_desc_split (vlib_main_t *vm, virtio_vring_t *vring, uword node_index)
 
static_always_inline void virtio_free_used_device_desc_packed (vlib_main_t *vm, virtio_vring_t *vring, uword node_index)
 
static_always_inline void virtio_free_used_device_desc (vlib_main_t *vm, virtio_vring_t *vring, uword node_index, int packed)
 
static_always_inline void set_checksum_offsets (vlib_buffer_t *b, virtio_net_hdr_v1_t *hdr, const int is_l2)
 
static_always_inline void set_gso_offsets (vlib_buffer_t *b, virtio_net_hdr_v1_t *hdr, const int is_l2)
 
static_always_inline u16 add_buffer_to_slot (vlib_main_t *vm, vlib_node_runtime_t *node, virtio_vring_t *vring, u32 bi, u16 free_desc_count, u16 avail, u16 next, u16 mask, int hdr_sz, int do_gso, int csum_offload, int is_pci, int is_tun, int is_indirect, int is_any_layout)
 
static_always_inline u16 add_buffer_to_slot_packed (vlib_main_t *vm, vlib_node_runtime_t *node, virtio_vring_t *vring, u32 bi, u16 next, int hdr_sz, int do_gso, int csum_offload, int is_pci, int is_tun, int is_indirect, int is_any_layout)
 
static_always_inline uword virtio_interface_tx_packed_gso_inline (vlib_main_t *vm, vlib_node_runtime_t *node, virtio_if_t *vif, virtio_if_type_t type, virtio_vring_t *vring, u32 *buffers, u16 n_left, const int do_gso, const int csum_offload)
 
static_always_inline void virtio_find_free_desc (virtio_vring_t *vring, u16 size, u16 mask, u16 req, u16 next, u32 *first_free_desc_index, u16 *free_desc_count)
 
static_always_inline u16 virtio_interface_tx_split_gso_inline (vlib_main_t *vm, vlib_node_runtime_t *node, virtio_if_t *vif, virtio_if_type_t type, virtio_vring_t *vring, u32 *buffers, u16 n_left, int do_gso, int csum_offload)
 
static_always_inline u16 virtio_interface_tx_gso_inline (vlib_main_t *vm, vlib_node_runtime_t *node, virtio_if_t *vif, virtio_if_type_t type, virtio_vring_t *vring, u32 *buffers, u16 n_left, int packed, int do_gso, int csum_offload)
 
static_always_inline u16 virtio_interface_tx_inline (vlib_main_t *vm, vlib_node_runtime_t *node, virtio_if_t *vif, virtio_vring_t *vring, virtio_if_type_t type, u32 *buffers, u16 n_left, int packed)
 
VNET_DEVICE_CLASS_TX_FN() virtio_device_class (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static void virtio_set_interface_next_node (vnet_main_t *vnm, u32 hw_if_index, u32 node_index)
 
static void virtio_clear_hw_interface_counters (u32 instance)
 
static_always_inline void virtio_set_rx_interrupt (virtio_if_t *vif, virtio_vring_t *vring)
 
static_always_inline void virtio_set_rx_polling (virtio_if_t *vif, virtio_vring_t *vring)
 
static clib_error_tvirtio_interface_rx_mode_change (vnet_main_t *vnm, u32 hw_if_index, u32 qid, vnet_hw_if_rx_mode mode)
 
static clib_error_tvirtio_interface_admin_up_down (vnet_main_t *vnm, u32 hw_if_index, u32 flags)
 
static clib_error_tvirtio_subif_add_del_function (vnet_main_t *vnm, u32 hw_if_index, struct vnet_sw_interface_t *st, int is_add)
 
 VNET_DEVICE_CLASS (virtio_device_class)
 

Variables

static char * virtio_tx_func_error_strings []
 

Macro Definition Documentation

◆ foreach_virtio_tx_func_error

#define foreach_virtio_tx_func_error
Value:
_(NO_FREE_SLOTS, "no free tx slots") \
_(TRUNC_PACKET, "packet > buffer size -- truncated in tx ring") \
_(PENDING_MSGS, "pending msgs in tx ring") \
_(INDIRECT_DESC_ALLOC_FAILED, "indirect descriptor allocation failed - packet drop") \
_(OUT_OF_ORDER, "out-of-order buffers in used ring") \
_(GSO_PACKET_DROP, "gso disabled on itf -- gso packet drop") \
_(CSUM_OFFLOAD_PACKET_DROP, "checksum offload disabled on itf -- csum offload packet drop")

Definition at line 34 of file device.c.

Enumeration Type Documentation

◆ virtio_tx_func_error_t

Enumerator
VIRTIO_TX_N_ERROR 

Definition at line 43 of file device.c.

Function Documentation

◆ add_buffer_to_slot()

static_always_inline u16 add_buffer_to_slot ( vlib_main_t vm,
vlib_node_runtime_t node,
virtio_vring_t vring,
u32  bi,
u16  free_desc_count,
u16  avail,
u16  next,
u16  mask,
int  hdr_sz,
int  do_gso,
int  csum_offload,
int  is_pci,
int  is_tun,
int  is_indirect,
int  is_any_layout 
)

Definition at line 369 of file device.c.

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

◆ add_buffer_to_slot_packed()

static_always_inline u16 add_buffer_to_slot_packed ( vlib_main_t vm,
vlib_node_runtime_t node,
virtio_vring_t vring,
u32  bi,
u16  next,
int  hdr_sz,
int  do_gso,
int  csum_offload,
int  is_pci,
int  is_tun,
int  is_indirect,
int  is_any_layout 
)

Definition at line 562 of file device.c.

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

◆ format_virtio_device()

static u8* format_virtio_device ( u8 s,
va_list *  args 
)
static

Definition at line 58 of file device.c.

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

◆ format_virtio_tx_trace()

static u8* format_virtio_tx_trace ( u8 s,
va_list *  va 
)
static

Definition at line 82 of file device.c.

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

◆ set_checksum_offsets()

static_always_inline void set_checksum_offsets ( vlib_buffer_t b,
virtio_net_hdr_v1_t *  hdr,
const int  is_l2 
)

Definition at line 282 of file device.c.

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

◆ set_gso_offsets()

static_always_inline void set_gso_offsets ( vlib_buffer_t b,
virtio_net_hdr_v1_t *  hdr,
const int  is_l2 
)

Definition at line 330 of file device.c.

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

◆ virtio_clear_hw_interface_counters()

static void virtio_clear_hw_interface_counters ( u32  instance)
static

Definition at line 1078 of file device.c.

+ Here is the caller graph for this function:

◆ virtio_device_class()

VNET_DEVICE_CLASS_TX_FN() virtio_device_class ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)

Definition at line 983 of file device.c.

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

◆ virtio_find_free_desc()

static_always_inline void virtio_find_free_desc ( virtio_vring_t vring,
u16  size,
u16  mask,
u16  req,
u16  next,
u32 first_free_desc_index,
u16 free_desc_count 
)

Definition at line 794 of file device.c.

+ Here is the caller graph for this function:

◆ virtio_free_used_device_desc()

static_always_inline void virtio_free_used_device_desc ( vlib_main_t vm,
virtio_vring_t vring,
uword  node_index,
int  packed 
)

Definition at line 271 of file device.c.

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

◆ virtio_free_used_device_desc_packed()

static_always_inline void virtio_free_used_device_desc_packed ( vlib_main_t vm,
virtio_vring_t vring,
uword  node_index 
)

Definition at line 230 of file device.c.

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

◆ virtio_free_used_device_desc_split()

static_always_inline void virtio_free_used_device_desc_split ( vlib_main_t vm,
virtio_vring_t vring,
uword  node_index 
)

Definition at line 164 of file device.c.

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

◆ virtio_interface_admin_up_down()

static clib_error_t* virtio_interface_admin_up_down ( vnet_main_t vnm,
u32  hw_if_index,
u32  flags 
)
static

Definition at line 1149 of file device.c.

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

◆ virtio_interface_drop_inline()

static_always_inline void virtio_interface_drop_inline ( vlib_main_t vm,
uword  node_index,
u32 buffers,
u16  n,
virtio_tx_func_error_t  error 
)

Definition at line 139 of file device.c.

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

◆ virtio_interface_rx_mode_change()

static clib_error_t* virtio_interface_rx_mode_change ( vnet_main_t vnm,
u32  hw_if_index,
u32  qid,
vnet_hw_if_rx_mode  mode 
)
static

Definition at line 1102 of file device.c.

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

◆ virtio_interface_tx_gso_inline()

static_always_inline u16 virtio_interface_tx_gso_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
virtio_if_t vif,
virtio_if_type_t  type,
virtio_vring_t vring,
u32 buffers,
u16  n_left,
int  packed,
int  do_gso,
int  csum_offload 
)

Definition at line 941 of file device.c.

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

◆ virtio_interface_tx_inline()

static_always_inline u16 virtio_interface_tx_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
virtio_if_t vif,
virtio_vring_t vring,
virtio_if_type_t  type,
u32 buffers,
u16  n_left,
int  packed 
)

Definition at line 958 of file device.c.

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

◆ virtio_interface_tx_packed_gso_inline()

static_always_inline uword virtio_interface_tx_packed_gso_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
virtio_if_t vif,
virtio_if_type_t  type,
virtio_vring_t vring,
u32 buffers,
u16  n_left,
const int  do_gso,
const int  csum_offload 
)

Definition at line 703 of file device.c.

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

◆ virtio_interface_tx_split_gso_inline()

static_always_inline u16 virtio_interface_tx_split_gso_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
virtio_if_t vif,
virtio_if_type_t  type,
virtio_vring_t vring,
u32 buffers,
u16  n_left,
int  do_gso,
int  csum_offload 
)

Definition at line 830 of file device.c.

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

◆ virtio_memset_ring_u32()

static_always_inline void virtio_memset_ring_u32 ( u32 ring,
u32  start,
u32  ring_size,
u32  n_buffers 
)

Definition at line 148 of file device.c.

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

◆ virtio_set_interface_next_node()

static void virtio_set_interface_next_node ( vnet_main_t vnm,
u32  hw_if_index,
u32  node_index 
)
static

Definition at line 1058 of file device.c.

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

◆ virtio_set_rx_interrupt()

static_always_inline void virtio_set_rx_interrupt ( virtio_if_t vif,
virtio_vring_t vring 
)

Definition at line 1084 of file device.c.

+ Here is the caller graph for this function:

◆ virtio_set_rx_polling()

static_always_inline void virtio_set_rx_polling ( virtio_if_t vif,
virtio_vring_t vring 
)

Definition at line 1093 of file device.c.

+ Here is the caller graph for this function:

◆ virtio_subif_add_del_function()

static clib_error_t* virtio_subif_add_del_function ( vnet_main_t vnm,
u32  hw_if_index,
struct vnet_sw_interface_t st,
int  is_add 
)
static

Definition at line 1170 of file device.c.

+ Here is the call graph for this function:

◆ virtio_tx_trace()

static_always_inline void virtio_tx_trace ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_buffer_t b0,
u32  bi,
int  is_tun 
)

Definition at line 103 of file device.c.

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

◆ VNET_DEVICE_CLASS()

VNET_DEVICE_CLASS ( virtio_device_class  )

Variable Documentation

◆ virtio_tx_func_error_strings

char* virtio_tx_func_error_strings[]
static
Initial value:
= {
#define _(n,s)
}
#define foreach_virtio_tx_func_error
Definition: device.c:34

Definition at line 51 of file device.c.