41 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 48 #define foreach_virtio_pci_api_msg \ 49 _(VIRTIO_PCI_CREATE, virtio_pci_create) \ 50 _(VIRTIO_PCI_CREATE_V2, virtio_pci_create_v2) \ 51 _(VIRTIO_PCI_DELETE, virtio_pci_delete) \ 52 _(SW_INTERFACE_VIRTIO_PCI_DUMP, sw_interface_virtio_pci_dump) 90 rmp->_vl_msg_id = htons (VL_API_VIRTIO_PCI_CREATE_REPLY);
117 "virtio gso api flag mismatch");
119 (
int) VIRTIO_FLAG_CSUM_OFFLOAD),
120 "virtio checksum offload api flag mismatch");
122 (
int) VIRTIO_FLAG_GRO_COALESCE),
123 "virtio gro coalesce api flag mismatch");
125 "virtio packed api flag mismatch");
127 (
int) VIRTIO_FLAG_IN_ORDER),
128 "virtio in-order api flag mismatch");
149 rmp->_vl_msg_id = htons (VL_API_VIRTIO_PCI_CREATE_V2_REPLY);
166 vl_api_virtio_pci_delete_reply_t *rmp;
174 rv = VNET_API_ERROR_INVALID_SW_IF_INDEX;
188 rmp->_vl_msg_id = htons (VL_API_VIRTIO_PCI_DELETE_REPLY);
190 rmp->retval = htonl (rv);
205 mp->_vl_msg_id = htons (VL_API_SW_INTERFACE_VIRTIO_PCI_DETAILS);
235 if (vif->type == VIRTIO_IF_TYPE_PCI)
237 virtio_pci_send_sw_interface_details
238 (am, reg, vif, mp->context);}
243 #define vl_msg_name_crc_list 245 #undef vl_msg_name_crc_list 250 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 251 foreach_vl_msg_name_crc_virtio;
261 vl_msg_api_set_handlers(VL_API_##N, #n, \ 262 vl_api_##n##_t_handler, \ 264 vl_api_##n##_t_endian, \ 265 vl_api_##n##_t_print, \ 266 sizeof(vl_api_##n##_t), 1);
vl_api_pci_address_t pci_addr
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)
vl_api_interface_index_t sw_if_index
#define foreach_virtio_pci_api_msg
vnet_device_class_t virtio_device_class
vl_api_interface_index_t sw_if_index
Initialize a new virtio pci interface with the given parameters.
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.
bool checksum_offload_enabled
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.
vl_api_mac_address_t mac_address
static void vl_api_virtio_pci_create_t_handler(vl_api_virtio_pci_create_t *mp)
Initialize a new virtio pci interface with the given parameters.
static void vl_api_virtio_pci_create_v2_t_handler(vl_api_virtio_pci_create_v2_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
u8 checksum_offload_enabled
Reply for virtio pci create reply.
Reply for virtio pci interface dump request.
vl_api_virtio_flags_t virtio_flags
static vnet_hw_interface_t * vnet_get_sup_hw_interface_api_visible_or_null(vnet_main_t *vnm, u32 sw_if_index)
vl_api_mac_address_t mac_addr
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)
vl_api_pci_address_t pci_addr
vl_api_mac_address_t mac_address
vl_api_pci_address_t pci_addr
#define STATIC_ASSERT(truth,...)
vl_api_interface_index_t sw_if_index
static api_main_t * vlibapi_get_main(void)
void pci_address_encode(const vlib_pci_addr_t *in, vl_api_pci_address_t *out)
void pci_address_decode(const vl_api_pci_address_t *in, vlib_pci_addr_t *out)
vpe_api_main_t vpe_api_main
vl_api_interface_index_t sw_if_index
virtio_vring_t * txq_vrings