41 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 48 #define foreach_vpe_api_msg \ 49 _(CREATE_VHOST_USER_IF, create_vhost_user_if) \ 50 _(MODIFY_VHOST_USER_IF, modify_vhost_user_if) \ 51 _(DELETE_VHOST_USER_IF, delete_vhost_user_if) \ 52 _(SW_INTERFACE_VHOST_USER_DUMP, sw_interface_vhost_user_dump) 62 u64 features = (
u64) ~ (0ULL);
63 u64 disabled_features = (
u64) (0ULL);
68 disabled_features = (1ULL << FEAT_VIRTIO_NET_F_MRG_RXBUF);
71 disabled_features |= (1ULL << FEAT_VIRTIO_F_INDIRECT_DESC);
78 features &= ~disabled_features;
116 vl_api_modify_vhost_user_if_reply_t *rmp;
118 u64 features = (
u64) ~ (0ULL);
119 u64 disabled_features = (
u64) (0ULL);
129 features &= ~disabled_features;
143 vl_api_delete_vhost_user_if_reply_t *rmp;
173 mp->_vl_msg_id = ntohs (VL_API_SW_INTERFACE_VHOST_USER_DETAILS);
202 u32 filter_sw_if_index;
209 if (filter_sw_if_index != ~0)
230 #define vl_msg_name_crc_list 232 #undef vl_msg_name_crc_list 237 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 238 foreach_vl_msg_name_crc_vhost_user;
248 vl_msg_api_set_handlers(VL_API_##N, #n, \ 249 vl_api_##n##_t_handler, \ 251 vl_api_##n##_t_endian, \ 252 vl_api_##n##_t_print, \ 253 sizeof(vl_api_##n##_t), 1); 258 am->
is_mp_safe[VL_API_CREATE_VHOST_USER_IF] = 1;
string interface_name[64]
static clib_error_t * vhost_user_api_hookup(vlib_main_t *vm)
VLIB_API_INIT_FUNCTION(vhost_user_api_hookup)
vnet_main_t * vnet_get_main(void)
Vhost-user interface details structure (fix this)
vl_api_mac_address_t mac_address
#define REPLY_MACRO2(t, body)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
static void vl_api_delete_vhost_user_if_t_handler(vl_api_delete_vhost_user_if_t *mp)
static void vnet_clear_sw_interface_tag(vnet_main_t *vnm, u32 sw_if_index)
string sock_filename[256]
bool disable_indirect_desc
vhost-user interface create request
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, u8 enable_gso)
void * vl_msg_api_alloc(int nbytes)
vl_api_virtio_net_features_last_32_t features_last_32
Vhost-user interface dump request.
vl_api_interface_index_t sw_if_index
static void vl_api_modify_vhost_user_if_t_handler(vl_api_modify_vhost_user_if_t *mp)
static void vl_api_create_vhost_user_if_t_handler(vl_api_create_vhost_user_if_t *mp)
vl_api_interface_index_t sw_if_index
string sock_filename[256]
#define foreach_vpe_api_msg
int vhost_user_delete_if(vnet_main_t *vnm, vlib_main_t *vm, u32 sw_if_index)
vhost-user interface create response
int vhost_user_dump_ifs(vnet_main_t *vnm, vlib_main_t *vm, vhost_user_intf_details_t **out_vuids)
static void setup_message_id_table(api_main_t *am)
API main structure, used by both vpp and binary API clients.
vl_api_interface_index_t sw_if_index
vl_api_virtio_net_features_first_32_t features_first_32
An API client registration, only in vpp/vlib.
#define vec_free(V)
Free vector's memory (no header).
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
void virtio_features_encode(u64 features, u32 *first, u32 *last)
vhost-user interface modify request
static void vnet_set_sw_interface_tag(vnet_main_t *vnm, u8 *tag, u32 sw_if_index)
static void send_sw_interface_vhost_user_details(vpe_api_main_t *am, vl_api_registration_t *reg, vhost_user_intf_details_t *vui, u32 context)
static vlib_main_t * vlib_get_main(void)
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, u8 enable_gso)
vl_api_interface_index_t sw_if_index
vl_api_interface_index_t sw_if_index
static api_main_t * vlibapi_get_main(void)
u8 * is_mp_safe
Message is mp safe vector.
#define vec_foreach(var, vec)
Vector iterator.
vhost-user interface delete request
vpe_api_main_t vpe_api_main
string sock_filename[256]
#define FEATURE_VIRTIO_NET_F_HOST_GUEST_TSO_FEATURE_BITS
void mac_address_decode(const u8 *in, mac_address_t *out)
Conversion functions to/from (decode/encode) API types to VPP internal types.
static void vl_api_sw_interface_vhost_user_dump_t_handler(vl_api_sw_interface_vhost_user_dump_t *mp)
vl_api_interface_index_t sw_if_index[default=0xffffffff]