FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
vhost_user_input.c File Reference
+ Include dependency graph for vhost_user_input.c:

Go to the source code of this file.

Macros

#define VHOST_USER_DOWN_DISCARD_COUNT   256
 
#define VHOST_USER_RX_BUFFER_STARVATION   32
 
#define VHOST_USER_RX_COPY_THRESHOLD   64
 
#define foreach_vhost_user_input_func_error
 

Enumerations

enum  vhost_user_input_func_error_t { VHOST_USER_INPUT_FUNC_N_ERROR }
 

Functions

static_always_inline void vhost_user_rx_trace (vhost_trace_t *t, vhost_user_intf_t *vui, u16 qid, vlib_buffer_t *b, vhost_user_vring_t *txvq, u16 last_avail_idx)
 
static_always_inline u32 vhost_user_input_copy (vhost_user_intf_t *vui, vhost_copy_t *cpy, u16 copy_len, u32 *map_hint)
 
static_always_inline u32 vhost_user_rx_discard_packet (vlib_main_t *vm, vhost_user_intf_t *vui, vhost_user_vring_t *txvq, u32 discard_max)
 Try to discard packets from the tx ring (VPP RX path). More...
 
static_always_inline void vhost_user_input_rewind_buffers (vlib_main_t *vm, vhost_cpu_t *cpu, vlib_buffer_t *b_head)
 
static_always_inline void vhost_user_handle_rx_offload (vlib_buffer_t *b0, u8 *b0_data, virtio_net_hdr_t *hdr)
 
static_always_inline void vhost_user_input_do_interrupt (vlib_main_t *vm, vhost_user_intf_t *vui, vhost_user_vring_t *txvq, vhost_user_vring_t *rxvq)
 
static_always_inline void vhost_user_input_setup_frame (vlib_main_t *vm, vlib_node_runtime_t *node, vhost_user_intf_t *vui, u32 *current_config_index, u32 *next_index, u32 **to_next, u32 *n_left_to_next)
 
static_always_inline u32 vhost_user_if_input (vlib_main_t *vm, vhost_user_main_t *vum, vhost_user_intf_t *vui, u16 qid, vlib_node_runtime_t *node, u8 enable_csum)
 
static_always_inline void vhost_user_mark_desc_consumed (vhost_user_intf_t *vui, vhost_user_vring_t *txvq, u16 desc_head, u16 n_descs_processed)
 
static_always_inline void vhost_user_rx_trace_packed (vhost_trace_t *t, vhost_user_intf_t *vui, u16 qid, vhost_user_vring_t *txvq, u16 desc_current)
 
static_always_inline u32 vhost_user_rx_discard_packet_packed (vlib_main_t *vm, vhost_user_intf_t *vui, vhost_user_vring_t *txvq, u32 discard_max)
 
static_always_inline u32 vhost_user_input_copy_packed (vhost_user_intf_t *vui, vhost_copy_t *cpy, u16 copy_len, u32 *map_hint)
 
static_always_inline u32 vhost_user_do_offload (vhost_user_intf_t *vui, vring_packed_desc_t *desc_table, u16 desc_current, u16 mask, vlib_buffer_t *b_head, u32 *map_hint)
 
static_always_inline u32 vhost_user_compute_buffers_required (u32 desc_len, u32 buffer_data_size)
 
static_always_inline u32 vhost_user_compute_indirect_desc_len (vhost_user_intf_t *vui, vhost_user_vring_t *txvq, u32 buffer_data_size, u16 desc_current, u32 *map_hint)
 
static_always_inline u32 vhost_user_compute_chained_desc_len (vhost_user_intf_t *vui, vhost_user_vring_t *txvq, u32 buffer_data_size, u16 *current, u16 *n_left)
 
static_always_inline void vhost_user_assemble_packet (vring_packed_desc_t *desc_table, u16 *desc_idx, vlib_buffer_t *b_head, vlib_buffer_t **b_current, u32 **next, vlib_buffer_t ***b, u32 *bi_current, vhost_cpu_t *cpu, u16 *copy_len, u32 *buffers_used, u32 buffers_required, u32 *desc_data_offset, u32 buffer_data_size, u16 mask)
 
static_always_inline u32 vhost_user_if_input_packed (vlib_main_t *vm, vhost_user_main_t *vum, vhost_user_intf_t *vui, u16 qid, vlib_node_runtime_t *node, u8 enable_csum)
 
VLIB_NODE_FN() vhost_user_input_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 

Variables

vlib_node_registration_t vhost_user_input_node
 (constructor) VLIB_REGISTER_NODE (vhost_user_input_node) More...
 
static __clib_unused char * vhost_user_input_func_error_strings []
 

Macro Definition Documentation

◆ foreach_vhost_user_input_func_error

#define foreach_vhost_user_input_func_error
Value:
_(NO_ERROR, "no error") \
_(NO_BUFFER, "no available buffer") \
_(MMAP_FAIL, "mmap failure") \
_(INDIRECT_OVERFLOW, "indirect descriptor overflows table") \
_(UNDERSIZED_FRAME, "undersized ethernet frame received (< 14 bytes)") \
_(NOT_READY, "vhost interface not ready or down") \
_(FULL_RX_QUEUE, "full rx queue (possible driver tx drop)")

Definition at line 70 of file vhost_user_input.c.

◆ VHOST_USER_DOWN_DISCARD_COUNT

#define VHOST_USER_DOWN_DISCARD_COUNT   256

Definition at line 50 of file vhost_user_input.c.

◆ VHOST_USER_RX_BUFFER_STARVATION

#define VHOST_USER_RX_BUFFER_STARVATION   32

Definition at line 56 of file vhost_user_input.c.

◆ VHOST_USER_RX_COPY_THRESHOLD

#define VHOST_USER_RX_COPY_THRESHOLD   64

Definition at line 66 of file vhost_user_input.c.

Enumeration Type Documentation

◆ vhost_user_input_func_error_t

Enumerator
VHOST_USER_INPUT_FUNC_N_ERROR 

Definition at line 79 of file vhost_user_input.c.

Function Documentation

◆ vhost_user_assemble_packet()

static_always_inline void vhost_user_assemble_packet ( vring_packed_desc_t *  desc_table,
u16 desc_idx,
vlib_buffer_t b_head,
vlib_buffer_t **  b_current,
u32 **  next,
vlib_buffer_t ***  b,
u32 bi_current,
vhost_cpu_t cpu,
u16 copy_len,
u32 buffers_used,
u32  buffers_required,
u32 desc_data_offset,
u32  buffer_data_size,
u16  mask 
)

Definition at line 1037 of file vhost_user_input.c.

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

◆ vhost_user_compute_buffers_required()

static_always_inline u32 vhost_user_compute_buffers_required ( u32  desc_len,
u32  buffer_data_size 
)

Definition at line 957 of file vhost_user_input.c.

+ Here is the caller graph for this function:

◆ vhost_user_compute_chained_desc_len()

static_always_inline u32 vhost_user_compute_chained_desc_len ( vhost_user_intf_t vui,
vhost_user_vring_t txvq,
u32  buffer_data_size,
u16 current,
u16 n_left 
)

Definition at line 1009 of file vhost_user_input.c.

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

◆ vhost_user_compute_indirect_desc_len()

static_always_inline u32 vhost_user_compute_indirect_desc_len ( vhost_user_intf_t vui,
vhost_user_vring_t txvq,
u32  buffer_data_size,
u16  desc_current,
u32 map_hint 
)

Definition at line 983 of file vhost_user_input.c.

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

◆ vhost_user_do_offload()

static_always_inline u32 vhost_user_do_offload ( vhost_user_intf_t vui,
vring_packed_desc_t *  desc_table,
u16  desc_current,
u16  mask,
vlib_buffer_t b_head,
u32 map_hint 
)

Definition at line 922 of file vhost_user_input.c.

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

◆ vhost_user_handle_rx_offload()

static_always_inline void vhost_user_handle_rx_offload ( vlib_buffer_t b0,
u8 b0_data,
virtio_net_hdr_t *  hdr 
)

Definition at line 248 of file vhost_user_input.c.

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

◆ vhost_user_if_input()

static_always_inline u32 vhost_user_if_input ( vlib_main_t vm,
vhost_user_main_t vum,
vhost_user_intf_t vui,
u16  qid,
vlib_node_runtime_t node,
u8  enable_csum 
)

Definition at line 381 of file vhost_user_input.c.

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

◆ vhost_user_if_input_packed()

static_always_inline u32 vhost_user_if_input_packed ( vlib_main_t vm,
vhost_user_main_t vum,
vhost_user_intf_t vui,
u16  qid,
vlib_node_runtime_t node,
u8  enable_csum 
)

Definition at line 1086 of file vhost_user_input.c.

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

◆ vhost_user_input_copy()

static_always_inline u32 vhost_user_input_copy ( vhost_user_intf_t vui,
vhost_copy_t cpy,
u16  copy_len,
u32 map_hint 
)

Definition at line 140 of file vhost_user_input.c.

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

◆ vhost_user_input_copy_packed()

static_always_inline u32 vhost_user_input_copy_packed ( vhost_user_intf_t vui,
vhost_copy_t cpy,
u16  copy_len,
u32 map_hint 
)

Definition at line 856 of file vhost_user_input.c.

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

◆ vhost_user_input_do_interrupt()

static_always_inline void vhost_user_input_do_interrupt ( vlib_main_t vm,
vhost_user_intf_t vui,
vhost_user_vring_t txvq,
vhost_user_vring_t rxvq 
)

Definition at line 329 of file vhost_user_input.c.

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

◆ vhost_user_input_node()

VLIB_NODE_FN() vhost_user_input_node ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)

Definition at line 1410 of file vhost_user_input.c.

+ Here is the call graph for this function:

◆ vhost_user_input_rewind_buffers()

static_always_inline void vhost_user_input_rewind_buffers ( vlib_main_t vm,
vhost_cpu_t cpu,
vlib_buffer_t b_head 
)

Definition at line 229 of file vhost_user_input.c.

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

◆ vhost_user_input_setup_frame()

static_always_inline void vhost_user_input_setup_frame ( vlib_main_t vm,
vlib_node_runtime_t node,
vhost_user_intf_t vui,
u32 current_config_index,
u32 next_index,
u32 **  to_next,
u32 n_left_to_next 
)

Definition at line 343 of file vhost_user_input.c.

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

◆ vhost_user_mark_desc_consumed()

static_always_inline void vhost_user_mark_desc_consumed ( vhost_user_intf_t vui,
vhost_user_vring_t txvq,
u16  desc_head,
u16  n_descs_processed 
)

Definition at line 764 of file vhost_user_input.c.

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

◆ vhost_user_rx_discard_packet()

static_always_inline u32 vhost_user_rx_discard_packet ( vlib_main_t vm,
vhost_user_intf_t vui,
vhost_user_vring_t txvq,
u32  discard_max 
)

Try to discard packets from the tx ring (VPP RX path).

Returns the number of discarded packets.

Definition at line 188 of file vhost_user_input.c.

+ Here is the caller graph for this function:

◆ vhost_user_rx_discard_packet_packed()

static_always_inline u32 vhost_user_rx_discard_packet_packed ( vlib_main_t vm,
vhost_user_intf_t vui,
vhost_user_vring_t txvq,
u32  discard_max 
)

Definition at line 826 of file vhost_user_input.c.

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

◆ vhost_user_rx_trace()

static_always_inline void vhost_user_rx_trace ( vhost_trace_t t,
vhost_user_intf_t vui,
u16  qid,
vlib_buffer_t b,
vhost_user_vring_t txvq,
u16  last_avail_idx 
)

Definition at line 94 of file vhost_user_input.c.

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

◆ vhost_user_rx_trace_packed()

static_always_inline void vhost_user_rx_trace_packed ( vhost_trace_t t,
vhost_user_intf_t vui,
u16  qid,
vhost_user_vring_t txvq,
u16  desc_current 
)

Definition at line 785 of file vhost_user_input.c.

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

Variable Documentation

◆ vhost_user_input_func_error_strings

__clib_unused char* vhost_user_input_func_error_strings[]
static
Initial value:

Definition at line 87 of file vhost_user_input.c.

◆ vhost_user_input_node

vlib_node_registration_t vhost_user_input_node
Initial value:
= {
.name = "vhost-user-input",
.sibling_of = "device-input",
.state = VLIB_NODE_STATE_DISABLED,
.format_trace = format_vhost_trace,
}

(constructor) VLIB_REGISTER_NODE (vhost_user_input_node)

Definition at line 1447 of file vhost_user_input.c.

VLIB_NODE_TYPE_INPUT
@ VLIB_NODE_TYPE_INPUT
Definition: node.h:76
VHOST_USER_INPUT_FUNC_N_ERROR
@ VHOST_USER_INPUT_FUNC_N_ERROR
Definition: vhost_user_input.c:84
foreach_vhost_user_input_func_error
#define foreach_vhost_user_input_func_error
Definition: vhost_user_input.c:70
VLIB_NODE_FLAG_TRACE_SUPPORTED
#define VLIB_NODE_FLAG_TRACE_SUPPORTED
Definition: node.h:295
format_ethernet_header_with_length
u8 * format_ethernet_header_with_length(u8 *s, va_list *args)
Definition: format.c:97
format_vhost_trace
static_always_inline u8 * format_vhost_trace(u8 *s, va_list *va)
Definition: vhost_user_inline.h:210
vhost_user_input_func_error_strings
static __clib_unused char * vhost_user_input_func_error_strings[]
Definition: vhost_user_input.c:87