42 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 45 #define vl_api_version(n,v) static u32 api_version=(v); 52 vl_print (handle, (char *)s); \ 58 #define foreach_vmxnet3_plugin_api_msg \ 59 _(VMXNET3_CREATE, vmxnet3_create) \ 60 _(VMXNET3_DELETE, vmxnet3_delete) \ 61 _(VMXNET3_DUMP, vmxnet3_dump) 88 rmp->sw_if_index = ntohl (args.sw_if_index);
99 s =
format (0,
"SCRIPT: vmxnet3_create ");
123 vl_api_vmxnet3_delete_reply_t *rmp;
133 rv = VNET_API_ERROR_INVALID_SW_IF_INDEX;
150 s =
format (0,
"SCRIPT: vmxnet3_delete ");
173 mp->_vl_msg_id = htons (VL_API_VMXNET3_DETAILS + vmxm->
msg_id_base);
242 swif = vnet_get_sw_interface (vnm, vd->sw_if_index);
243 if_name = format (if_name,
"%U%c", format_vnet_sw_interface_name, vnm,
245 send_vmxnet3_details (reg, vd, swif, if_name, mp->context);
246 _vec_len (if_name) = 0;
258 s =
format (0,
"SCRIPT: vmxnet3_dump ");
263 #define vl_msg_name_crc_list 265 #undef vl_msg_name_crc_list 270 #define _(id,n,crc) \ 271 vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id + vmxm->msg_id_base); 272 foreach_vl_msg_name_crc_vmxnet3;
279 #define _(n,f) api_main.msg_print_handlers \ 280 [VL_API_##n + vmxm->msg_id_base] \ 281 = (void *) vl_api_##f##_t_print; 295 name =
format (0,
"vmxnet3_%08x%c", api_version, 0);
302 vl_msg_api_set_handlers((VL_API_##N + vmxm->msg_id_base), \ 304 vl_api_##n##_t_handler, \ 306 vl_api_##n##_t_endian, \ 307 vl_api_##n##_t_print, \ 308 sizeof(vl_api_##n##_t), 1);
void vmxnet3_delete_if(vlib_main_t *vm, vmxnet3_device_t *vd)
static void * vl_api_vmxnet3_dump_t_print(vl_api_vmxnet3_dump_t *mp, void *handle)
#define vec_foreach_index(var, v)
Iterate over vector indices.
Dump all vmxnet3 interfaces.
vnet_main_t * vnet_get_main(void)
static vnet_hw_interface_t * vnet_get_sup_hw_interface(vnet_main_t *vnm, u32 sw_if_index)
#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 send_vmxnet3_details(vl_api_registration_t *reg, vmxnet3_device_t *vd, vnet_sw_interface_t *swif, u8 *interface_name, u32 context)
vmxnet3_main_t vmxnet3_main
void vmxnet3_create_if(vlib_main_t *vm, vmxnet3_create_if_args_t *args)
void * vl_msg_api_alloc(int nbytes)
static void setup_message_id_table(vmxnet3_main_t *vmxm, api_main_t *am)
static void vl_api_vmxnet3_create_t_handler(vl_api_vmxnet3_create_t *mp)
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
static void * vl_api_vmxnet3_delete_t_print(vl_api_vmxnet3_delete_t *mp, void *handle)
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
Memory interface details structure.
vmxnet3_rx_comp_ring rx_comp_ring
vmxnet3_tx_comp_ring tx_comp_ring
vl_api_vmxnet3_rx_list_t rx_list[16]
#define VMXNET3_RX_RING_SIZE
vnet_sw_interface_flags_t flags
API main structure, used by both vpp and binary API clients.
An API client registration, only in vpp/vlib.
vl_api_vmxnet3_tx_list_t tx_list[8]
#define vec_free(V)
Free vector's memory (no header).
static vnet_hw_interface_t * vnet_get_sup_hw_interface_api_visible_or_null(vnet_main_t *vnm, u32 sw_if_index)
#define foreach_vmxnet3_plugin_api_msg
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
static void vl_api_vmxnet3_delete_t_handler(vl_api_vmxnet3_delete_t *mp)
vmxnet3_rx_list structure
static void plugin_custom_dump_configure(vmxnet3_main_t *vmxm)
clib_error_t * vmxnet3_plugin_api_hookup(vlib_main_t *vm)
static vlib_main_t * vlib_get_main(void)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
vnet_device_class_t vmxnet3_device_class
vmxnet3_rx_ring rx_ring[VMXNET3_RX_RING_SIZE]
vmxnet3_tx_list structure
vmxnet3_device_t * devices
static void * vl_api_vmxnet3_create_t_print(vl_api_vmxnet3_create_t *mp, void *handle)
static void vl_api_vmxnet3_dump_t_handler(vl_api_vmxnet3_dump_t *mp)
Message handler for vmxnet3_dump API.
format_function_t format_vlib_pci_addr
u16 vl_msg_api_get_msg_ids(const char *name, int n)