FD.io VPP  v18.01.2-1-g9b554f3
Vector Packet Processing
vhost-user.c File Reference

vHost User Device Driver. More...

+ Include dependency graph for vhost-user.c:

Go to the source code of this file.

Macros

#define VHOST_DEBUG_VQ   0
 
#define DBG_SOCK(args...)
 
#define DBG_VQ(args...)
 
#define VHOST_USER_DOWN_DISCARD_COUNT   256
 
#define VHOST_USER_RX_BUFFER_STARVATION   32
 
#define VHOST_USER_RX_COPY_THRESHOLD   64
 
#define VHOST_USER_TX_COPY_THRESHOLD   (VHOST_USER_COPY_ARRAY_N - 40)
 
#define UNIX_GET_FD(unixfd_idx)
 
#define foreach_virtio_trace_flags
 
#define foreach_vhost_user_tx_func_error
 
#define foreach_vhost_user_input_func_error
 
#define VHOST_LOG_PAGE   0x1000
 
#define vhost_user_log_dirty_ring(vui, vq, member)
 
#define foreach_protocol_feature
 

Enumerations

enum  virtio_trace_flag_t { foreach_virtio_trace_flags }
 
enum  vhost_user_tx_func_error_t { VHOST_USER_TX_FUNC_N_ERROR }
 
enum  vhost_user_input_func_error_t { VHOST_USER_INPUT_FUNC_N_ERROR }
 

Functions

 VNET_HW_INTERFACE_CLASS (vhost_interface_class, static)
 
static u8format_vhost_user_interface_name (u8 *s, va_list *args)
 
static int vhost_user_name_renumber (vnet_hw_interface_t *hi, u32 new_dev_instance)
 
static_always_inline void * map_guest_mem (vhost_user_intf_t *vui, uword addr, u32 *hint)
 
static void * map_user_mem (vhost_user_intf_t *vui, uword addr)
 
static long get_huge_page_size (int fd)
 
static void unmap_all_mem_regions (vhost_user_intf_t *vui)
 
static void vhost_user_tx_thread_placement (vhost_user_intf_t *vui)
 
static void vhost_user_rx_thread_placement ()
 Unassign existing interface/queue to thread mappings and re-assign new interface/queue to thread mappings. More...
 
int vhost_user_intf_ready (vhost_user_intf_t *vui)
 Returns whether at least one TX and one RX vring are enabled. More...
 
static void vhost_user_update_iface_state (vhost_user_intf_t *vui)
 
static void vhost_user_set_interrupt_pending (vhost_user_intf_t *vui, u32 ifq)
 
static clib_error_tvhost_user_callfd_read_ready (clib_file_t *uf)
 
static clib_error_tvhost_user_kickfd_read_ready (clib_file_t *uf)
 
static int vhost_user_vring_try_lock (vhost_user_intf_t *vui, u32 qid)
 Try once to lock the vring. More...
 
static void vhost_user_vring_lock (vhost_user_intf_t *vui, u32 qid)
 Spin until the vring is successfully locked. More...
 
static void vhost_user_vring_unlock (vhost_user_intf_t *vui, u32 qid)
 Unlock the vring lock. More...
 
static void vhost_user_vring_init (vhost_user_intf_t *vui, u32 qid)
 
static void vhost_user_vring_close (vhost_user_intf_t *vui, u32 qid)
 
static void vhost_user_if_disconnect (vhost_user_intf_t *vui)
 
static_always_inline void vhost_user_log_dirty_pages_2 (vhost_user_intf_t *vui, u64 addr, u64 len, u8 is_host_address)
 
static_always_inline void vhost_user_log_dirty_pages (vhost_user_intf_t *vui, u64 addr, u64 len)
 
static clib_error_tvhost_user_socket_read (clib_file_t *uf)
 
static clib_error_tvhost_user_socket_error (clib_file_t *uf)
 
static clib_error_tvhost_user_socksvr_accept_ready (clib_file_t *uf)
 
static clib_error_tvhost_user_init (vlib_main_t *vm)
 
static u8format_vhost_trace (u8 *s, va_list *va)
 
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)
 
static void vhost_user_send_call (vlib_main_t *vm, vhost_user_vring_t *vq)
 
static_always_inline u32 vhost_user_input_copy (vhost_user_intf_t *vui, vhost_copy_t *cpy, u16 copy_len, u32 *map_hint)
 
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 void vhost_user_input_rewind_buffers (vlib_main_t *vm, vhost_cpu_t *cpu, vlib_buffer_t *b_head)
 
static 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, vnet_hw_interface_rx_mode mode)
 
static uword vhost_user_input (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *f)
 
void vhost_user_tx_trace (vhost_trace_t *t, vhost_user_intf_t *vui, u16 qid, vlib_buffer_t *b, vhost_user_vring_t *rxvq)
 
static_always_inline u32 vhost_user_tx_copy (vhost_user_intf_t *vui, vhost_copy_t *cpy, u16 copy_len, u32 *map_hint)
 
static uword vhost_user_tx (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static uword vhost_user_send_interrupt_process (vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
 
static clib_error_tvhost_user_interface_rx_mode_change (vnet_main_t *vnm, u32 hw_if_index, u32 qid, vnet_hw_interface_rx_mode mode)
 
static clib_error_tvhost_user_interface_admin_up_down (vnet_main_t *vnm, u32 hw_if_index, u32 flags)
 
 VNET_DEVICE_CLASS (vhost_user_dev_class, static)
 
 VLIB_DEVICE_TX_FUNCTION_MULTIARCH (vhost_user_dev_class, vhost_user_tx)
 
static void vhost_user_term_if (vhost_user_intf_t *vui)
 Disables and reset interface structure. More...
 
int vhost_user_delete_if (vnet_main_t *vnm, vlib_main_t *vm, u32 sw_if_index)
 
static clib_error_tvhost_user_exit (vlib_main_t *vm)
 
static int vhost_user_init_server_sock (const char *sock_filename, int *sock_fd)
 Open server unix socket on specified sock_filename. More...
 
static void vhost_user_create_ethernet (vnet_main_t *vnm, vlib_main_t *vm, vhost_user_intf_t *vui, u8 *hwaddress)
 Create ethernet interface for vhost user interface. More...
 
static void vhost_user_vui_init (vnet_main_t *vnm, vhost_user_intf_t *vui, int server_sock_fd, const char *sock_filename, u64 feature_mask, u32 *sw_if_index)
 
int vhost_user_create_if (vnet_main_t *vnm, vlib_main_t *vm, const char *sock_filename, u8 is_server, u32 *sw_if_index, u64 feature_mask, u8 renumber, u32 custom_dev_instance, u8 *hwaddr)
 
int vhost_user_modify_if (vnet_main_t *vnm, vlib_main_t *vm, const char *sock_filename, u8 is_server, u32 sw_if_index, u64 feature_mask, u8 renumber, u32 custom_dev_instance)
 
clib_error_tvhost_user_connect_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
clib_error_tvhost_user_delete_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
int vhost_user_dump_ifs (vnet_main_t *vnm, vlib_main_t *vm, vhost_user_intf_details_t **out_vuids)
 
clib_error_tshow_vhost_user_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
clib_error_tdebug_vhost_user_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tvhost_user_config (vlib_main_t *vm, unformat_input_t *input)
 
void vhost_user_unmap_all (void)
 

Variables

vlib_node_registration_t vhost_user_input_node
 (constructor) VLIB_REGISTER_NODE (vhost_user_input_node) More...
 
static char * vhost_user_tx_func_error_strings []
 
static char * vhost_user_input_func_error_strings []
 
static vhost_user_main_t vhost_user_main
 
static vlib_node_registration_t vhost_user_send_interrupt_node
 (constructor) VLIB_REGISTER_NODE (vhost_user_send_interrupt_node) More...
 
static vlib_node_registration_t vhost_user_process_node
 (constructor) VLIB_REGISTER_NODE (vhost_user_process_node) More...
 
static vlib_cli_command_t vhost_user_connect_command
 (constructor) VLIB_CLI_COMMAND (vhost_user_connect_command) More...
 
static vlib_cli_command_t vhost_user_delete_command
 (constructor) VLIB_CLI_COMMAND (vhost_user_delete_command) More...
 
static vlib_cli_command_t show_vhost_user_command
 (constructor) VLIB_CLI_COMMAND (show_vhost_user_command) More...
 
static vlib_cli_command_t debug_vhost_user_command
 (constructor) VLIB_CLI_COMMAND (debug_vhost_user_command) More...
 

Detailed Description

vHost User Device Driver.

This file contains the source code for vHost User interface.

Definition in file vhost-user.c.

Macro Definition Documentation

#define DBG_SOCK (   args...)
Value:
{ \
vhost_user_main_t *_vum = &vhost_user_main; \
if (_vum->debug) \
clib_warning(args); \
};
#define clib_warning(format, args...)
Definition: error.h:59
static vhost_user_main_t vhost_user_main
Definition: vhost-user.c:166

Definition at line 54 of file vhost-user.c.

#define DBG_VQ (   args...)

Definition at line 64 of file vhost-user.c.

#define foreach_protocol_feature
Value:
#define VHOST_USER_PROTOCOL_F_LOG_SHMFD
Definition: vhost-user.h:32
#define VHOST_USER_PROTOCOL_F_MQ
Definition: vhost-user.h:31
#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)") \
_(FULL_RX_QUEUE, "full rx queue (possible driver tx drop)")

Definition at line 143 of file vhost-user.c.

#define foreach_vhost_user_tx_func_error
Value:
_(NONE, "no error") \
_(NOT_READY, "vhost vring not ready") \
_(DOWN, "vhost interface is down") \
_(PKT_DROP_NOBUF, "tx packet drops (no available descriptors)") \
_(PKT_DROP_NOMRG, "tx packet drops (cannot merge descriptors)") \
_(MMAP_FAIL, "mmap failure") \
_(INDIRECT_OVERFLOW, "indirect descriptor table overflow")

Definition at line 120 of file vhost-user.c.

#define foreach_virtio_trace_flags
Value:
_ (SIMPLE_CHAINED, 0, "Simple descriptor chaining") \
_ (SINGLE_DESC, 1, "Single descriptor packet") \
_ (INDIRECT, 2, "Indirect descriptor") \
_ (MAP_ERROR, 4, "Memory mapping error")

Definition at line 105 of file vhost-user.c.

#define UNIX_GET_FD (   unixfd_idx)
Value:
(unixfd_idx != ~0) ? \
unixfd_idx)->file_descriptor : -1;
clib_file_t * file_pool
Definition: file.h:76
clib_file_main_t file_main
Definition: main.c:63
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
Definition: pool.h:459

Definition at line 100 of file vhost-user.c.

#define VHOST_DEBUG_VQ   0

Definition at line 52 of file vhost-user.c.

#define VHOST_LOG_PAGE   0x1000

Definition at line 625 of file vhost-user.c.

#define VHOST_USER_DOWN_DISCARD_COUNT   256

Definition at line 72 of file vhost-user.c.

#define vhost_user_log_dirty_ring (   vui,
  vq,
  member 
)
Value:
if (PREDICT_FALSE(vq->log_used)) { \
vhost_user_log_dirty_pages(vui, vq->log_guest_addr + STRUCT_OFFSET_OF(vring_used_t, member), \
sizeof(vq->used->member)); \
}
#define STRUCT_OFFSET_OF(t, f)
Definition: clib.h:62
static_always_inline void vhost_user_log_dirty_pages(vhost_user_intf_t *vui, u64 addr, u64 len)
Definition: vhost-user.c:655
#define PREDICT_FALSE(x)
Definition: clib.h:105

Definition at line 660 of file vhost-user.c.

#define VHOST_USER_RX_BUFFER_STARVATION   32

Definition at line 78 of file vhost-user.c.

#define VHOST_USER_RX_COPY_THRESHOLD   64

Definition at line 88 of file vhost-user.c.

#define VHOST_USER_TX_COPY_THRESHOLD   (VHOST_USER_COPY_ARRAY_N - 40)

Definition at line 98 of file vhost-user.c.

Enumeration Type Documentation

Enumerator
VHOST_USER_INPUT_FUNC_N_ERROR 

Definition at line 151 of file vhost-user.c.

Enumerator
VHOST_USER_TX_FUNC_N_ERROR 

Definition at line 129 of file vhost-user.c.

Enumerator
foreach_virtio_trace_flags 

Definition at line 111 of file vhost-user.c.

Function Documentation

clib_error_t* debug_vhost_user_command_fn ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)

Definition at line 3570 of file vhost-user.c.

+ Here is the call graph for this function:

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

Definition at line 1258 of file vhost-user.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 176 of file vhost-user.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static long get_huge_page_size ( int  fd)
static

Definition at line 296 of file vhost-user.c.

+ Here is the caller graph for this function:

static_always_inline void* map_guest_mem ( vhost_user_intf_t vui,
uword  addr,
u32 hint 
)

Definition at line 210 of file vhost-user.c.

+ Here is the caller graph for this function:

static void* map_user_mem ( vhost_user_intf_t vui,
uword  addr 
)
inlinestatic

Definition at line 279 of file vhost-user.c.

+ Here is the caller graph for this function:

clib_error_t* show_vhost_user_command_fn ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)

Definition at line 3133 of file vhost-user.c.

+ Here is the call graph for this function:

static void unmap_all_mem_regions ( vhost_user_intf_t vui)
static

Definition at line 304 of file vhost-user.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* vhost_user_callfd_read_ready ( clib_file_t uf)
static

Definition at line 490 of file vhost-user.c.

+ Here is the caller graph for this function:

static clib_error_t* vhost_user_config ( vlib_main_t vm,
unformat_input_t input 
)
static

Definition at line 3628 of file vhost-user.c.

+ Here is the call graph for this function:

clib_error_t* vhost_user_connect_command_fn ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)

Definition at line 2970 of file vhost-user.c.

+ Here is the call graph for this function:

static void vhost_user_create_ethernet ( vnet_main_t vnm,
vlib_main_t vm,
vhost_user_intf_t vui,
u8 hwaddress 
)
static

Create ethernet interface for vhost user interface.

Definition at line 2763 of file vhost-user.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int vhost_user_create_if ( vnet_main_t vnm,
vlib_main_t vm,
const char *  sock_filename,
u8  is_server,
u32 sw_if_index,
u64  feature_mask,
u8  renumber,
u32  custom_dev_instance,
u8 hwaddr 
)

Definition at line 2861 of file vhost-user.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t* vhost_user_delete_command_fn ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)

Definition at line 3035 of file vhost-user.c.

+ Here is the call graph for this function:

int vhost_user_delete_if ( vnet_main_t vnm,
vlib_main_t vm,
u32  sw_if_index 
)

Definition at line 2644 of file vhost-user.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int vhost_user_dump_ifs ( vnet_main_t vnm,
vlib_main_t vm,
vhost_user_intf_details_t **  out_vuids 
)

Definition at line 3082 of file vhost-user.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* vhost_user_exit ( vlib_main_t vm)
static

Definition at line 2701 of file vhost-user.c.

+ Here is the call graph for this function:

static void vhost_user_if_disconnect ( vhost_user_intf_t vui)
inlinestatic

Definition at line 603 of file vhost-user.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static 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,
vnet_hw_interface_rx_mode  mode 
)
static

Definition at line 1468 of file vhost-user.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* vhost_user_init ( vlib_main_t vm)
static

Definition at line 1225 of file vhost-user.c.

+ Here is the call graph for this function:

static int vhost_user_init_server_sock ( const char *  sock_filename,
int *  sock_fd 
)
static

Open server unix socket on specified sock_filename.

Definition at line 2723 of file vhost-user.c.

+ Here is the caller graph for this function:

static uword vhost_user_input ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t f 
)
static

Definition at line 1851 of file vhost-user.c.

+ Here is the call graph for this function:

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 1362 of file vhost-user.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 1449 of file vhost-user.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 2468 of file vhost-user.c.

+ Here is the call graph for this function:

static clib_error_t* vhost_user_interface_rx_mode_change ( vnet_main_t vnm,
u32  hw_if_index,
u32  qid,
vnet_hw_interface_rx_mode  mode 
)
static

Definition at line 2405 of file vhost-user.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int vhost_user_intf_ready ( vhost_user_intf_t vui)

Returns whether at least one TX and one RX vring are enabled.

Definition at line 444 of file vhost-user.c.

+ Here is the caller graph for this function:

static clib_error_t* vhost_user_kickfd_read_ready ( clib_file_t uf)
static

Definition at line 501 of file vhost-user.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static_always_inline void vhost_user_log_dirty_pages ( vhost_user_intf_t vui,
u64  addr,
u64  len 
)

Definition at line 655 of file vhost-user.c.

+ Here is the call graph for this function:

static_always_inline void vhost_user_log_dirty_pages_2 ( vhost_user_intf_t vui,
u64  addr,
u64  len,
u8  is_host_address 
)

Definition at line 627 of file vhost-user.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int vhost_user_modify_if ( vnet_main_t vnm,
vlib_main_t vm,
const char *  sock_filename,
u8  is_server,
u32  sw_if_index,
u64  feature_mask,
u8  renumber,
u32  custom_dev_instance 
)

Definition at line 2919 of file vhost-user.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int vhost_user_name_renumber ( vnet_hw_interface_t hi,
u32  new_dev_instance 
)
static

Definition at line 193 of file vhost-user.c.

+ Here is the caller graph for this function:

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 1410 of file vhost-user.c.

+ Here is the caller graph for this function:

static void vhost_user_rx_thread_placement ( )
static

Unassign existing interface/queue to thread mappings and re-assign new interface/queue to thread mappings.

Definition at line 380 of file vhost-user.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 
)

Definition at line 1296 of file vhost-user.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vhost_user_send_call ( vlib_main_t vm,
vhost_user_vring_t vq 
)
inlinestatic

Definition at line 1342 of file vhost-user.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword vhost_user_send_interrupt_process ( vlib_main_t vm,
vlib_node_runtime_t rt,
vlib_frame_t f 
)
static

Definition at line 2308 of file vhost-user.c.

+ Here is the call graph for this function:

static void vhost_user_set_interrupt_pending ( vhost_user_intf_t vui,
u32  ifq 
)
static

Definition at line 474 of file vhost-user.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* vhost_user_socket_error ( clib_file_t uf)
static

Definition at line 1181 of file vhost-user.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* vhost_user_socket_read ( clib_file_t uf)
static

Definition at line 667 of file vhost-user.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* vhost_user_socksvr_accept_ready ( clib_file_t uf)
static

Definition at line 1197 of file vhost-user.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vhost_user_term_if ( vhost_user_intf_t vui)
static

Disables and reset interface structure.

It can then be either init again, or removed from used interfaces.

Definition at line 2615 of file vhost-user.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword vhost_user_tx ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
static

Definition at line 1981 of file vhost-user.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 1933 of file vhost-user.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vhost_user_tx_thread_placement ( vhost_user_intf_t vui)
static

Definition at line 340 of file vhost-user.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void vhost_user_tx_trace ( vhost_trace_t t,
vhost_user_intf_t vui,
u16  qid,
vlib_buffer_t b,
vhost_user_vring_t rxvq 
)

Definition at line 1898 of file vhost-user.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void vhost_user_unmap_all ( void  )

Definition at line 3652 of file vhost-user.c.

+ Here is the call graph for this function:

static void vhost_user_update_iface_state ( vhost_user_intf_t vui)
static

Definition at line 456 of file vhost-user.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vhost_user_vring_close ( vhost_user_intf_t vui,
u32  qid 
)
inlinestatic

Definition at line 577 of file vhost-user.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vhost_user_vring_init ( vhost_user_intf_t vui,
u32  qid 
)
inlinestatic

Definition at line 555 of file vhost-user.c.

+ Here is the caller graph for this function:

static void vhost_user_vring_lock ( vhost_user_intf_t vui,
u32  qid 
)
inlinestatic

Spin until the vring is successfully locked.

Definition at line 539 of file vhost-user.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int vhost_user_vring_try_lock ( vhost_user_intf_t vui,
u32  qid 
)
inlinestatic

Try once to lock the vring.

Returns
0 on success, non-zero on failure.

Definition at line 530 of file vhost-user.c.

+ Here is the caller graph for this function:

static void vhost_user_vring_unlock ( vhost_user_intf_t vui,
u32  qid 
)
inlinestatic

Unlock the vring lock.

Definition at line 549 of file vhost-user.c.

+ Here is the caller graph for this function:

static void vhost_user_vui_init ( vnet_main_t vnm,
vhost_user_intf_t vui,
int  server_sock_fd,
const char *  sock_filename,
u64  feature_mask,
u32 sw_if_index 
)
static

Definition at line 2801 of file vhost-user.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

VLIB_DEVICE_TX_FUNCTION_MULTIARCH ( vhost_user_dev_class  ,
vhost_user_tx   
)

Definition at line 2499 of file vhost-user.c.

+ Here is the call graph for this function:

VNET_DEVICE_CLASS ( vhost_user_dev_class  ,
static   
)

+ Here is the caller graph for this function:

VNET_HW_INTERFACE_CLASS ( vhost_interface_class  ,
static   
)

Variable Documentation

vlib_cli_command_t debug_vhost_user_command
static
Initial value:
= {
.path = "debug vhost-user",
.short_help = "debug vhost-user <on | off>",
}
clib_error_t * debug_vhost_user_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: vhost-user.c:3570

(constructor) VLIB_CLI_COMMAND (debug_vhost_user_command)

Definition at line 3620 of file vhost-user.c.

vlib_cli_command_t show_vhost_user_command
static
Initial value:
= {
.path = "show vhost-user",
.short_help = "show vhost-user [<interface> [<interface> [..]]] [descriptors]",
}
clib_error_t * show_vhost_user_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: vhost-user.c:3133

(constructor) VLIB_CLI_COMMAND (show_vhost_user_command)

Definition at line 3562 of file vhost-user.c.

vlib_cli_command_t vhost_user_connect_command
static
Initial value:
= {
.path = "create vhost-user",
.short_help = "create vhost-user socket <socket-filename> [server] "
"[feature-mask <hex>] [hwaddr <mac-addr>] [renumber <dev_instance>] ",
}
clib_error_t * vhost_user_connect_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: vhost-user.c:2970

(constructor) VLIB_CLI_COMMAND (vhost_user_connect_command)

Definition at line 3401 of file vhost-user.c.

vlib_cli_command_t vhost_user_delete_command
static
Initial value:
= {
.path = "delete vhost-user",
.short_help = "delete vhost-user {<interface> | sw_if_index <sw_idx>}",
}
clib_error_t * vhost_user_delete_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: vhost-user.c:3035

(constructor) VLIB_CLI_COMMAND (vhost_user_delete_command)

Definition at line 3422 of file vhost-user.c.

char* vhost_user_input_func_error_strings[]
static
Initial value:
= {
#define _(n,s)
}
#define foreach_vhost_user_input_func_error
Definition: vhost-user.c:143

Definition at line 159 of file vhost-user.c.

vlib_node_registration_t vhost_user_input_node
Initial value:
= {
.function = vhost_user_input,
.name = "vhost-user-input",
.sibling_of = "device-input",
.state = VLIB_NODE_STATE_DISABLED,
.format_trace = format_vhost_trace,
}
static uword vhost_user_input(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *f)
Definition: vhost-user.c:1851
static char * vhost_user_input_func_error_strings[]
Definition: vhost-user.c:159
u8 * format_ethernet_header_with_length(u8 *s, va_list *args)
Definition: format.c:91
static u8 * format_vhost_trace(u8 *s, va_list *va)
Definition: vhost-user.c:1258

(constructor) VLIB_REGISTER_NODE (vhost_user_input_node)

Definition at line 118 of file vhost-user.c.

vhost_user_main_t vhost_user_main
static
Initial value:
= {
.mtu_bytes = 1518,
}

Definition at line 166 of file vhost-user.c.

vlib_node_registration_t vhost_user_process_node
static
Initial value:
= {
.function = vhost_user_process,
.name = "vhost-user-process",
}

(constructor) VLIB_REGISTER_NODE (vhost_user_process_node)

Definition at line 2603 of file vhost-user.c.

vlib_node_registration_t vhost_user_send_interrupt_node
static
Initial value:
= {
.name = "vhost-user-send-interrupt-process",
}
static uword vhost_user_send_interrupt_process(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
Definition: vhost-user.c:2308

(constructor) VLIB_REGISTER_NODE (vhost_user_send_interrupt_node)

Definition at line 2397 of file vhost-user.c.

char* vhost_user_tx_func_error_strings[]
static
Initial value:
= {
#define _(n,s)
}
#define foreach_vhost_user_tx_func_error
Definition: vhost-user.c:120

Definition at line 137 of file vhost-user.c.