40 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 47 #define foreach_virtio_pci_api_msg \ 48 _(VIRTIO_PCI_CREATE, virtio_pci_create) \ 49 _(VIRTIO_PCI_DELETE, virtio_pci_delete) \ 50 _(SW_INTERFACE_VIRTIO_PCI_DUMP, sw_interface_virtio_pci_dump) 80 rmp->_vl_msg_id = htons (VL_API_VIRTIO_PCI_CREATE_REPLY);
97 vl_api_virtio_pci_delete_reply_t *rmp;
105 rv = VNET_API_ERROR_INVALID_SW_IF_INDEX;
119 rmp->_vl_msg_id = htons (VL_API_VIRTIO_PCI_DELETE_REPLY);
121 rmp->retval = htonl (rv);
136 mp->_vl_msg_id = htons (VL_API_SW_INTERFACE_VIRTIO_PCI_DETAILS);
165 if (vif->type == VIRTIO_IF_TYPE_PCI)
167 virtio_pci_send_sw_interface_details
168 (am, reg, vif, mp->context);}
173 #define vl_msg_name_crc_list 175 #undef vl_msg_name_crc_list 180 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 181 foreach_vl_msg_name_crc_virtio;
191 vl_msg_api_set_handlers(VL_API_##N, #n, \ 192 vl_api_##n##_t_handler, \ 194 vl_api_##n##_t_endian, \ 195 vl_api_##n##_t_print, \ 196 sizeof(vl_api_##n##_t), 1);
vnet_main_t * vnet_get_main(void)
Reply for virtio pci create reply.
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
#define foreach_virtio_pci_api_msg
vnet_device_class_t virtio_device_class
Initialize a new virtio pci interface with the given paramters.
Dump virtio pci interfaces request.
void * vl_msg_api_alloc(int nbytes)
Delete virtio pci interface.
void virtio_pci_create_if(vlib_main_t *vm, virtio_pci_create_if_args_t *args)
VLIB_API_INIT_FUNCTION(virtio_pci_api_hookup)
static clib_error_t * virtio_pci_api_hookup(vlib_main_t *vm)
#define clib_memcpy(d, s, n)
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
static void virtio_pci_send_sw_interface_details(vpe_api_main_t *am, vl_api_registration_t *reg, virtio_if_t *vif, u32 context)
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
static void vl_api_virtio_pci_delete_t_handler(vl_api_virtio_pci_delete_t *mp)
static void setup_message_id_table(api_main_t *am)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static void vl_api_virtio_pci_create_t_handler(vl_api_virtio_pci_create_t *mp)
API main structure, used by both vpp and binary API clients.
An API client registration, only in vpp/vlib.
virtio_vring_t * rxq_vrings
Reply for virtio pci interface dump request.
static vnet_hw_interface_t * vnet_get_sup_hw_interface_api_visible_or_null(vnet_main_t *vnm, u32 sw_if_index)
static void vl_api_sw_interface_virtio_pci_dump_t_handler(vl_api_sw_interface_virtio_pci_dump_t *mp)
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
int virtio_pci_delete_if(vlib_main_t *vm, virtio_if_t *vif)
virtio_main_t virtio_main
static vlib_main_t * vlib_get_main(void)
vpe_api_main_t vpe_api_main
virtio_vring_t * txq_vrings