42 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 48 #define vl_api_version(n,v) static u32 api_version=(v); 54 #define foreach_vmxnet3_plugin_api_msg \ 55 _(VMXNET3_CREATE, vmxnet3_create) \ 56 _(VMXNET3_DELETE, vmxnet3_delete) \ 57 _(VMXNET3_DUMP, vmxnet3_dump) 81 rmp->sw_if_index = ntohl (args.sw_if_index);
92 vl_api_vmxnet3_delete_reply_t *rmp;
100 rv = VNET_API_ERROR_INVALID_INTERFACE;
116 u8 * interface_name,
u32 context)
130 mp->_vl_msg_id = htons (VL_API_VMXNET3_DETAILS + vmxm->
msg_id_base);
186 swif = vnet_get_sw_interface (vnm, vd->sw_if_index);
187 if_name = format (if_name,
"%U%c", format_vnet_sw_interface_name, vnm,
189 rxq = vec_elt_at_index (vd->rxqs, qid);
190 txq = vec_elt_at_index (vd->txqs, qid);
191 send_vmxnet3_details (reg, vd, qid, rxq, qid, txq, swif, if_name,
193 _vec_len (if_name) = 0;
200 #define vl_msg_name_crc_list 202 #undef vl_msg_name_crc_list 207 #define _(id,n,crc) \ 208 vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id + vmxm->msg_id_base); 209 foreach_vl_msg_name_crc_vmxnet3;
222 name =
format (0,
"vmxnet3_%08x%c", api_version, 0);
229 vl_msg_api_set_handlers((VL_API_##N + vmxm->msg_id_base), \ 231 vl_api_##n##_t_handler, \ 233 vl_api_##n##_t_endian, \ 234 vl_api_##n##_t_print, \ 235 sizeof(vl_api_##n##_t), 1);
void vmxnet3_delete_if(vlib_main_t *vm, vmxnet3_device_t *vd)
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)
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.
#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
static void send_vmxnet3_details(vl_api_registration_t *reg, vmxnet3_device_t *vd, u16 rx_qid, vmxnet3_rxq_t *rxq, u16 tx_qid, vmxnet3_txq_t *txq, vnet_sw_interface_t *swif, u8 *interface_name, u32 context)
vmxnet3_tx_comp_ring tx_comp_ring
#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.
#define vec_free(V)
Free vector's memory (no header).
#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)
clib_error_t * vmxnet3_plugin_api_hookup(vlib_main_t *vm)
static vlib_main_t * vlib_get_main(void)
vnet_device_class_t vmxnet3_device_class
vmxnet3_rx_ring rx_ring[VMXNET3_RX_RING_SIZE]
vmxnet3_device_t * devices
static void vl_api_vmxnet3_dump_t_handler(vl_api_vmxnet3_dump_t *mp)
Message handler for vmxnet3_dump API.
u16 vl_msg_api_get_msg_ids(const char *name, int n)