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_CREATE_V2, virtio_pci_create_v2) \ 50 _(VIRTIO_PCI_DELETE, virtio_pci_delete) \ 51 _(SW_INTERFACE_VIRTIO_PCI_DUMP, sw_interface_virtio_pci_dump) 89 rmp->_vl_msg_id = htons (VL_API_VIRTIO_PCI_CREATE_REPLY);
116 "virtio gso api flag mismatch");
118 (
int) VIRTIO_FLAG_CSUM_OFFLOAD),
119 "virtio checksum offload api flag mismatch");
121 (
int) VIRTIO_FLAG_GRO_COALESCE),
122 "virtio gro coalesce api flag mismatch");
124 "virtio packed api flag mismatch");
126 (
int) VIRTIO_FLAG_IN_ORDER),
127 "virtio in-order api flag mismatch");
129 (
int) VIRTIO_FLAG_BUFFERING),
130 "virtio buffering api flag mismatch");
151 rmp->_vl_msg_id = htons (VL_API_VIRTIO_PCI_CREATE_V2_REPLY);
168 vl_api_virtio_pci_delete_reply_t *rmp;
176 rv = VNET_API_ERROR_INVALID_SW_IF_INDEX;
190 rmp->_vl_msg_id = htons (VL_API_VIRTIO_PCI_DELETE_REPLY);
192 rmp->retval = htonl (rv);
207 mp->_vl_msg_id = htons (VL_API_SW_INTERFACE_VIRTIO_PCI_DETAILS);
237 if (vif->
type == VIRTIO_IF_TYPE_PCI)
244 #define vl_msg_name_crc_list 246 #undef vl_msg_name_crc_list 251 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 252 foreach_vl_msg_name_crc_virtio;
262 vl_msg_api_set_handlers(VL_API_##N, #n, \ 263 vl_api_##n##_t_handler, \ 265 vl_api_##n##_t_endian, \ 266 vl_api_##n##_t_print, \ 267 sizeof(vl_api_##n##_t), 1);
vl_api_pci_address_t pci_addr
vnet_main_t * vnet_get_main(void)
#define pool_foreach(VAR, POOL)
Iterate through pool.
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)
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